* feat(#2415): granular highlight_diagnostics, normalise groups (#2454) * chore: normalise colours and enable cterm (#2471) * feat(#2415): granular highlight_git, normalise git groups (#2487) * docs: update CONTRIBUTING.md (#2485) * feat(#2415): granular highlight_git, normalise git groups * feat(#2415): normalise and add modified groups * feat(#2415): create Decorator class for modified and bookmarks * feat(#2415): create DecoratorDiagnostics * feat(#2415): create DecoratorGit * feat(#2415): create DecoratorGit * add DecoratorCopied DecoratorCut * add DecoratorOpened * remove unloaded_bufnr checks as the view debouncer takes care of it * Add `renderer.highlight_git` to accepted strings * fix(#2415): builder refactor (#2538) * simplify builder signs * decorators take care of themselves and are priority ordered * simplify builder hl groups * refactor builder for icon arrays * builder use decorators generically * fix(#2415): harden sign creation (#2539) * fix(#2415): harden unicode signs * Decorator tidy * normalise git sign creation and tidy * tidy builder * NvimTreeBookmarkIcon * tidy HL doc * tidy HL doc * tidy HL doc * tidy builder doc * standardise on '---@param' * DiagnosticWarning -> DiagnosticWarn * annotate decorators * limit to two highlight groups for line rendering * style * apply #2519 * feat(#2415): combined hl groups (#2601) * feat(#2415): create combined highlight groups * feat(#2415): create combined highlight groups * feat(#2415): create combined highlight groups * ci: allow workflow_dispatch (#2620) * one and only one hl namespace, required winhl removal * small tidies * colors.lua -> appearance.lua * full-name uses one and only namespace * don't highlight fast, just apply to namespace, safer win_set_hl * gut builder (#2622) collapse Builder * fix group_empty function check * feat(#2415): highlight-overhaul release date --------- Co-authored-by: Akmadan23 <azadahmadi@mailo.com>
91 lines
3.0 KiB
Lua
91 lines
3.0 KiB
Lua
local utils = require "nvim-tree.utils"
|
|
local notify = require "nvim-tree.notify"
|
|
|
|
local M = {}
|
|
|
|
local function refactored(opts)
|
|
-- 2022/06/20
|
|
utils.move_missing_val(opts, "update_focused_file", "update_cwd", opts, "update_focused_file", "update_root", true)
|
|
utils.move_missing_val(opts, "", "update_cwd", opts, "", "sync_root_with_cwd", true)
|
|
|
|
-- 2022/11/07
|
|
utils.move_missing_val(opts, "", "open_on_tab", opts, "tab.sync", "open", false)
|
|
utils.move_missing_val(opts, "", "open_on_tab", opts, "tab.sync", "close", true)
|
|
utils.move_missing_val(opts, "", "ignore_buf_on_tab_change", opts, "tab.sync", "ignore", true)
|
|
|
|
-- 2022/11/22
|
|
utils.move_missing_val(opts, "renderer", "root_folder_modifier", opts, "renderer", "root_folder_label", true)
|
|
|
|
-- 2023/01/01
|
|
utils.move_missing_val(opts, "update_focused_file", "debounce_delay", opts, "view", "debounce_delay", true)
|
|
|
|
-- 2023/01/08
|
|
utils.move_missing_val(opts, "trash", "require_confirm", opts, "ui.confirm", "trash", true)
|
|
|
|
-- 2023/01/15
|
|
if type(opts.view) == "table" and opts.view.adaptive_size ~= nil then
|
|
if opts.view.adaptive_size and type(opts.view.width) ~= "table" then
|
|
local width = opts.view.width
|
|
opts.view.width = {
|
|
min = width,
|
|
}
|
|
end
|
|
opts.view.adaptive_size = nil
|
|
end
|
|
|
|
-- 2023/07/15
|
|
utils.move_missing_val(opts, "", "sort_by", opts, "sort", "sorter", true)
|
|
|
|
-- 2023/07/16
|
|
utils.move_missing_val(opts, "git", "ignore", opts, "filters", "git_ignored", true)
|
|
|
|
-- 2023/08/26
|
|
utils.move_missing_val(opts, "renderer.icons", "webdev_colors", opts, "renderer.icons.web_devicons.file", "color", true)
|
|
|
|
-- 2023/10/08
|
|
if type(opts.renderer) == "table" and type(opts.renderer.highlight_diagnostics) == "boolean" then
|
|
opts.renderer.highlight_diagnostics = opts.renderer.highlight_diagnostics and "name" or "none"
|
|
end
|
|
|
|
-- 2023/10/21
|
|
if type(opts.renderer) == "table" and type(opts.renderer.highlight_git) == "boolean" then
|
|
opts.renderer.highlight_git = opts.renderer.highlight_git and "name" or "none"
|
|
end
|
|
end
|
|
|
|
local function deprecated(opts)
|
|
if type(opts.view) == "table" and 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)
|
|
if opts.auto_close then
|
|
notify.warn "auto close feature has been removed, see note in the README (tips & reminder section)"
|
|
opts.auto_close = nil
|
|
end
|
|
|
|
if opts.focus_empty_on_setup then
|
|
notify.warn "focus_empty_on_setup has been removed and will be replaced by a new startup configuration. Please remove this option. See https://bit.ly/3yJch2T"
|
|
opts.focus_empty_on_setup = nil
|
|
end
|
|
|
|
if opts.create_in_closed_folder then
|
|
notify.warn "create_in_closed_folder has been removed and is now the default behaviour. You may use api.fs.create to add a file under your desired node."
|
|
end
|
|
opts.create_in_closed_folder = nil
|
|
end
|
|
|
|
function M.migrate_legacy_options(opts)
|
|
-- silently move
|
|
refactored(opts)
|
|
|
|
-- warn
|
|
deprecated(opts)
|
|
|
|
-- warn and delete
|
|
removed(opts)
|
|
end
|
|
|
|
return M
|