committed by
GitHub
parent
80d4f28383
commit
736cc843e1
@@ -276,6 +276,7 @@ Subsequent calls to setup will replace the previous configuration.
|
|||||||
git = {
|
git = {
|
||||||
enable = true,
|
enable = true,
|
||||||
ignore = true,
|
ignore = true,
|
||||||
|
show_on_dirs = true,
|
||||||
timeout = 400,
|
timeout = 400,
|
||||||
},
|
},
|
||||||
actions = {
|
actions = {
|
||||||
@@ -464,8 +465,7 @@ Show LSP and COC diagnostics in the signcolumn
|
|||||||
Type: `boolean`, Default: `false`
|
Type: `boolean`, Default: `false`
|
||||||
|
|
||||||
*nvim-tree.diagnostics.show_on_dirs*
|
*nvim-tree.diagnostics.show_on_dirs*
|
||||||
If the node with diagnostic is not visible, then show diagnostic in the
|
Show diagnostic icons on parent directories.
|
||||||
parent directory.
|
|
||||||
Type: `boolean`, Default: `false`
|
Type: `boolean`, Default: `false`
|
||||||
|
|
||||||
*nvim-tree.diagnostics.icons*
|
*nvim-tree.diagnostics.icons*
|
||||||
@@ -491,6 +491,10 @@ Git integration with icons and colors.
|
|||||||
Toggle via the `toggle_git_ignored` action, default mapping `I`.
|
Toggle via the `toggle_git_ignored` action, default mapping `I`.
|
||||||
Type: `boolean`, Default: `true`
|
Type: `boolean`, Default: `true`
|
||||||
|
|
||||||
|
*nvim-tree.git.show_on_dirs*
|
||||||
|
Show status icons of children when directory itself has no status icon.
|
||||||
|
Type: `boolean`, Default: `true`
|
||||||
|
|
||||||
*nvim-tree.git.timeout*
|
*nvim-tree.git.timeout*
|
||||||
Kills the git process after some time if it takes too long.
|
Kills the git process after some time if it takes too long.
|
||||||
Type: `number`, Default: `400` (ms)
|
Type: `number`, Default: `400` (ms)
|
||||||
|
|||||||
@@ -529,6 +529,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
|
|||||||
git = {
|
git = {
|
||||||
enable = true,
|
enable = true,
|
||||||
ignore = true,
|
ignore = true,
|
||||||
|
show_on_dirs = true,
|
||||||
timeout = 400,
|
timeout = 400,
|
||||||
},
|
},
|
||||||
actions = {
|
actions = {
|
||||||
|
|||||||
@@ -6,9 +6,15 @@ local function get_dir_git_status(parent_ignored, status, absolute_path)
|
|||||||
if parent_ignored then
|
if parent_ignored then
|
||||||
return "!!"
|
return "!!"
|
||||||
end
|
end
|
||||||
local dir_status = status.dirs and status.dirs[absolute_path]
|
|
||||||
local file_status = status.files and status.files[absolute_path]
|
local file_status = status.files and status.files[absolute_path]
|
||||||
return dir_status or file_status
|
if file_status then
|
||||||
|
return file_status
|
||||||
|
end
|
||||||
|
|
||||||
|
if M.config.git.show_on_dirs then
|
||||||
|
return status.dirs and status.dirs[absolute_path]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_git_status(parent_ignored, status, absolute_path)
|
local function get_git_status(parent_ignored, status, absolute_path)
|
||||||
@@ -37,4 +43,10 @@ function M.update_git_status(node, parent_ignored, status)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.setup(opts)
|
||||||
|
M.config = {
|
||||||
|
git = opts.git,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ function Explorer:_clear_watchers()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.setup(opts)
|
function M.setup(opts)
|
||||||
|
require("nvim-tree.explorer.common").setup(opts)
|
||||||
require("nvim-tree.explorer.explore").setup(opts)
|
require("nvim-tree.explorer.explore").setup(opts)
|
||||||
require("nvim-tree.explorer.filters").setup(opts)
|
require("nvim-tree.explorer.filters").setup(opts)
|
||||||
require("nvim-tree.explorer.sorters").setup(opts)
|
require("nvim-tree.explorer.sorters").setup(opts)
|
||||||
|
|||||||
Reference in New Issue
Block a user