parent
48d53a5934
commit
e16083cb01
@ -749,6 +749,7 @@ Window / buffer setup.
|
|||||||
Type: `number`, Default: `15` (ms)
|
Type: `number`, Default: `15` (ms)
|
||||||
|
|
||||||
*nvim-tree.view.hide_root_folder*
|
*nvim-tree.view.hide_root_folder*
|
||||||
|
Deprecated: please set |nvim-tree.renderer.root_folder_label| to `false`.
|
||||||
Hide the path of the current working directory on top of the tree.
|
Hide the path of the current working directory on top of the tree.
|
||||||
Type: `boolean`, Default: `false`
|
Type: `boolean`, Default: `false`
|
||||||
|
|
||||||
@ -868,13 +869,14 @@ UI rendering setup
|
|||||||
This can be used with or without the icons.
|
This can be used with or without the icons.
|
||||||
Type: `string`, Default `"none"`
|
Type: `string`, Default `"none"`
|
||||||
|
|
||||||
*nvim-tree.renderer.root_folder_label* (previously `renderer.root_folder_modifier`)
|
*nvim-tree.renderer.root_folder_label*
|
||||||
In what format to show root folder. See `:help filename-modifiers` for
|
In what format to show root folder. See `:help filename-modifiers` for
|
||||||
available `string` options.
|
available `string` options.
|
||||||
Type: `string` or `function(root_cwd)`, Default: `":~:s?$?/..?"`
|
Set to `false` to hide the root folder.
|
||||||
|
Type: `string` or `boolean` or `function(root_cwd)`, Default: `":~:s?$?/..?"`
|
||||||
|
|
||||||
Function is passed the absolute path of the root folder and should return a string.
|
Function is passed the absolute path of the root folder and should
|
||||||
e.g. >
|
return a string. e.g. >
|
||||||
my_root_folder_label = function(path)
|
my_root_folder_label = function(path)
|
||||||
return ".../" .. vim.fn.fnamemodify(path, ":t")
|
return ".../" .. vim.fn.fnamemodify(path, ":t")
|
||||||
end
|
end
|
||||||
|
|||||||
@ -595,7 +595,7 @@ local FIELD_OVERRIDE_TYPECHECK = {
|
|||||||
remove_keymaps = { boolean = true, table = true },
|
remove_keymaps = { boolean = true, table = true },
|
||||||
on_attach = { ["function"] = true, string = true },
|
on_attach = { ["function"] = true, string = true },
|
||||||
sort_by = { ["function"] = true, string = true },
|
sort_by = { ["function"] = true, string = true },
|
||||||
root_folder_label = { ["function"] = true, string = true },
|
root_folder_label = { ["function"] = true, string = true, boolean = true },
|
||||||
picker = { ["function"] = true, string = true },
|
picker = { ["function"] = true, string = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,12 @@ local function refactored(opts)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function deprecated(opts)
|
||||||
|
if opts.view.hide_root_folder then
|
||||||
|
notify.info "view.hide_root_folder is deprecated, please set renderer.root_folder_label = false"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function removed(opts)
|
local function removed(opts)
|
||||||
if opts.auto_close then
|
if opts.auto_close then
|
||||||
notify.warn "auto close feature has been removed, see note in the README (tips & reminder section)"
|
notify.warn "auto close feature has been removed, see note in the README (tips & reminder section)"
|
||||||
@ -64,6 +70,9 @@ function M.migrate_legacy_options(opts)
|
|||||||
-- silently move
|
-- silently move
|
||||||
refactored(opts)
|
refactored(opts)
|
||||||
|
|
||||||
|
-- warn
|
||||||
|
deprecated(opts)
|
||||||
|
|
||||||
-- warn and delete
|
-- warn and delete
|
||||||
removed(opts)
|
removed(opts)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -513,7 +513,7 @@ function M.setup(opts)
|
|||||||
M.View.centralize_selection = options.centralize_selection
|
M.View.centralize_selection = options.centralize_selection
|
||||||
M.View.side = (options.side == "right") and "right" or "left"
|
M.View.side = (options.side == "right") and "right" or "left"
|
||||||
M.View.height = options.height
|
M.View.height = options.height
|
||||||
M.View.hide_root_folder = options.hide_root_folder
|
M.View.hide_root_folder = options.hide_root_folder or opts.renderer.root_folder_label == false
|
||||||
M.View.tab = opts.tab
|
M.View.tab = opts.tab
|
||||||
M.View.preserve_window_proportions = options.preserve_window_proportions
|
M.View.preserve_window_proportions = options.preserve_window_proportions
|
||||||
M.View.winopts.cursorline = options.cursorline
|
M.View.winopts.cursorline = options.cursorline
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user