1210 silent migrate more options (#1215)

This commit is contained in:
Alexander Courtis 2022-05-07 19:13:46 +10:00 committed by GitHub
parent 483f1550d1
commit 97d8557cb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 12 deletions

View File

@ -426,10 +426,6 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
} -- END_DEFAULT_OPTS
local function merge_options(conf)
if conf and conf.update_to_buf_dir then
conf.hijack_directories = conf.update_to_buf_dir
conf.update_to_buf_dir = nil
end
return vim.tbl_deep_extend("force", DEFAULT_OPTS, conf or {})
end

View File

@ -179,17 +179,35 @@ local g_migrations = {
}
local function refactored(opts)
if opts.view then
if opts.view.mappings then
if opts.view.mappings.list then
for _, m in pairs(opts.view.mappings.list) do
if m.action == "toggle_ignored" then
m.action = "toggle_git_ignored"
end
end
-- mapping actions
if opts.view and opts.view.mappings and opts.view.mappings.list then
for _, m in pairs(opts.view.mappings.list) do
if m.action == "toggle_ignored" then
m.action = "toggle_git_ignored"
end
end
end
-- update_to_buf_dir -> hijack_directories
if opts.update_to_buf_dir ~= nil then
utils.table_create_missing(opts, "hijack_directories")
if opts.hijack_directories.enable == nil then
opts.hijack_directories.enable = opts.update_to_buf_dir.enable
end
if opts.hijack_directories.auto_open == nil then
opts.hijack_directories.auto_open = opts.update_to_buf_dir.auto_open
end
opts.update_to_buf_dir = nil
end
-- view.auto_resize -> actions.open_file.resize_window
if opts.view and opts.view.auto_resize ~= nil then
utils.table_create_missing(opts, "actions.open_file")
if opts.actions.open_file.resize_window == nil then
opts.actions.open_file.resize_window = opts.view.auto_resize
end
opts.view.auto_resize = nil
end
end
local function removed(opts)