neovim requirement 0.7.0 -> 0.8.0, remove WinSeparator/VertSplit compatibility shims

This commit is contained in:
Alexander Courtis
2022-12-16 13:45:16 +11:00
parent 949913f186
commit cdb40dc42e
5 changed files with 7 additions and 15 deletions

View File

@@ -745,8 +745,8 @@ local function validate_options(conf)
end
function M.setup(conf)
if vim.fn.has "nvim-0.7" == 0 then
vim.notify_once("nvim-tree.lua requires Neovim 0.7 or higher", vim.log.levels.WARN)
if vim.fn.has "nvim-0.8" == 0 then
vim.notify_once("nvim-tree.lua requires Neovim 0.8 or higher", vim.log.levels.WARN)
return
end

View File

@@ -69,8 +69,7 @@ local function get_links()
CursorLineNr = "CursorLineNr",
LineNr = "LineNr",
CursorLine = "CursorLine",
VertSplit = "VertSplit",
WinSeparator = "NvimTreeVertSplit",
WinSeparator = "WinSeparator",
CursorColumn = "CursorColumn",
FileDirty = "NvimTreeGitDirty",
FileNew = "NvimTreeGitNew",

View File

@@ -4,12 +4,6 @@ local events = require "nvim-tree.events"
local utils = require "nvim-tree.utils"
local log = require "nvim-tree.log"
local function get_win_sep_hl()
-- #1221 WinSeparator not present in nvim 0.6.1 and some builds of 0.7.0
local has_win_sep = pcall(vim.cmd, "silent hi WinSeparator")
return has_win_sep and "WinSeparator:NvimTreeWinSeparator" or "VertSplit:NvimTreeWinSeparator"
end
M.View = {
adaptive_size = false,
centralize_selection = false,
@@ -38,7 +32,7 @@ M.View = {
"CursorLine:NvimTreeCursorLine",
"CursorLineNr:NvimTreeCursorLineNr",
"LineNr:NvimTreeLineNr",
get_win_sep_hl(),
"WinSeparator:NvimTreeWinSeparator",
"StatusLine:NvimTreeStatusLine",
"StatusLineNC:NvimTreeStatuslineNC",
"SignColumn:NvimTreeSignColumn",