Merge pull request #69 from nyngwang/feat-setup-view-options-add-is_excluded
feat: add `setup.view_options.is_always_hidden`
This commit is contained in:
commit
642bb30323
2 changed files with 6 additions and 1 deletions
|
|
@ -58,6 +58,10 @@ local default_config = {
|
|||
is_hidden_file = function(name, bufnr)
|
||||
return vim.startswith(name, ".")
|
||||
end,
|
||||
-- This function defines what will never be shown, even when `show_hidden` is set
|
||||
is_always_hidden = function(name, bufnr)
|
||||
return false
|
||||
end,
|
||||
},
|
||||
-- Configuration for the floating window in oil.open_float
|
||||
float = {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ local last_cursor_entry = {}
|
|||
---@return boolean
|
||||
M.should_display = function(entry, bufnr)
|
||||
local name = entry[FIELD.name]
|
||||
return config.view_options.show_hidden or not config.view_options.is_hidden_file(name, bufnr)
|
||||
return not config.view_options.is_always_hidden(name, bufnr)
|
||||
and (not config.view_options.is_hidden_file(name, bufnr) or config.view_options.show_hidden)
|
||||
end
|
||||
|
||||
---@param bufname string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue