chore: move old option into setup from entrypoint to legacy.lua
This commit is contained in:
@@ -328,21 +328,21 @@ local function setup_autocommands(opts)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local DEFAULT_OPTS = {
|
local DEFAULT_OPTS = {
|
||||||
disable_netrw = false,
|
auto_close = false,
|
||||||
hijack_netrw = true,
|
auto_reload_on_write = true,
|
||||||
open_on_setup = false,
|
disable_netrw = false,
|
||||||
|
hide_root_folder = false,
|
||||||
|
hijack_cursor = false,
|
||||||
|
hijack_netrw = true,
|
||||||
|
hijack_unnamed_buffer_when_opening = false,
|
||||||
ignore_buffer_on_setup = false,
|
ignore_buffer_on_setup = false,
|
||||||
open_on_tab = false,
|
open_on_setup = false,
|
||||||
hijack_directories = {
|
open_on_tab = false,
|
||||||
|
update_cwd = false,
|
||||||
|
hijack_directories = {
|
||||||
enable = true,
|
enable = true,
|
||||||
auto_open = true,
|
auto_open = true,
|
||||||
},
|
},
|
||||||
auto_close = false,
|
|
||||||
auto_reload_on_write = true,
|
|
||||||
hijack_cursor = false,
|
|
||||||
update_cwd = false,
|
|
||||||
hide_root_folder = false,
|
|
||||||
hijack_unnamed_buffer_when_opening = false,
|
|
||||||
update_focused_file = {
|
update_focused_file = {
|
||||||
enable = false,
|
enable = false,
|
||||||
update_cwd = false,
|
update_cwd = false,
|
||||||
@@ -376,10 +376,10 @@ local DEFAULT_OPTS = {
|
|||||||
actions = {
|
actions = {
|
||||||
change_dir = {
|
change_dir = {
|
||||||
enable = true,
|
enable = true,
|
||||||
global = vim.g.nvim_tree_change_dir_global == 1,
|
global = false,
|
||||||
},
|
},
|
||||||
open_file = {
|
open_file = {
|
||||||
quit_on_open = vim.g.nvim_tree_quit_on_open == 1,
|
quit_on_open = false,
|
||||||
resize_window = false,
|
resize_window = false,
|
||||||
window_picker = {
|
window_picker = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|||||||
@@ -161,6 +161,20 @@ local migrations = {
|
|||||||
o.actions.open_file.window_picker.exclude = vim.g.nvim_tree_window_picker_exclude
|
o.actions.open_file.window_picker.exclude = vim.g.nvim_tree_window_picker_exclude
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
nvim_tree_quit_on_open = function(o)
|
||||||
|
utils.table_create_missing(o, "actions.open_file")
|
||||||
|
if o.actions.open_file.quit_on_open == nil then
|
||||||
|
o.actions.open_file.quit_on_open = vim.g.nvim_tree_quit_on_open == 1
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
nvim_tree_change_dir_global = function(o)
|
||||||
|
utils.table_create_missing(o, "actions.change_dir")
|
||||||
|
if o.actions.change_dir.global == nil then
|
||||||
|
o.actions.change_dir.global = vim.g.nvim_tree_change_dir_global == 1
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.migrate_legacy_options(opts)
|
function M.migrate_legacy_options(opts)
|
||||||
|
|||||||
Reference in New Issue
Block a user