Merge remote-tracking branch 'origin/master' into 2941-move-lib-to-explorer

This commit is contained in:
Alexander Courtis
2024-10-26 09:11:13 +11:00
18 changed files with 74 additions and 37 deletions

View File

@@ -107,9 +107,11 @@ local function dotfile(self, path)
return self.config.filter_dotfiles and utils.path_basename(path):sub(1, 1) == "."
end
---Bookmark is present
---@param path string
---@param path_type string|nil filetype of path
---@param bookmarks table<string, string|nil> path, filetype table of bookmarked files
---@return boolean
local function bookmark(self, path, path_type, bookmarks)
if not self.config.filter_no_bookmark then
return false

View File

@@ -188,6 +188,7 @@ end
---@param node DirectoryNode
---@param git_status table|nil
---@return Node[]?
function Explorer:reload(node, git_status)
local cwd = node.link_to or node.absolute_path
local handle = vim.loop.fs_scandir(cwd)

View File

@@ -13,6 +13,7 @@ local LiveFilter = {}
---@param opts table
---@param explorer Explorer
---@return LiveFilter
function LiveFilter:new(opts, explorer)
local o = {
explorer = explorer,

View File

@@ -17,7 +17,7 @@ end
--- Predefined comparator, defaulting to name
---@param sorter string as per options
---@return function
---@return fun(a: Node, b: Node): boolean
function Sorter:get_comparator(sorter)
return function(a, b)
return (C[sorter] or C.name)(a, b, self.config)
@@ -41,6 +41,7 @@ end
---Evaluate `sort.folders_first` and `sort.files_first`
---@param a Node
---@param b Node
---@param cfg table
---@return boolean|nil
local function folders_or_files_first(a, b, cfg)
if not (cfg.folders_first or cfg.files_first) then
@@ -164,6 +165,7 @@ end
---@param a Node
---@param b Node
---@param ignorecase boolean|nil
---@param cfg table
---@return boolean
local function node_comparator_name_ignorecase_or_not(a, b, ignorecase, cfg)
if not (a and b) then