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

@ -28,7 +28,7 @@ Take a look at the [wiki](https://github.com/nvim-tree/nvim-tree.lua/wiki) for S
## Requirements ## Requirements
[neovim >=0.7.0](https://github.com/neovim/neovim/wiki/Installing-Neovim) [neovim >=0.8.0](https://github.com/neovim/neovim/wiki/Installing-Neovim)
[nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) is optional and used to display file icons. It requires a [patched font](https://www.nerdfonts.com/). Your terminal emulator must be configured to use that font, usually "Hack Nerd Font" [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) is optional and used to display file icons. It requires a [patched font](https://www.nerdfonts.com/). Your terminal emulator must be configured to use that font, usually "Hack Nerd Font"

View File

@ -58,7 +58,7 @@ Git Integration
Requirements Requirements
This file explorer requires `neovim >= 0.7.0` This file explorer requires `neovim >= 0.8.0`
============================================================================== ==============================================================================
2. QUICK START *nvim-tree-quickstart* 2. QUICK START *nvim-tree-quickstart*
@ -1474,8 +1474,7 @@ NvimTreeEndOfBuffer (NonText)
NvimTreeCursorLine (CursorLine) NvimTreeCursorLine (CursorLine)
NvimTreeCursorLineNr (CursorLineNr) NvimTreeCursorLineNr (CursorLineNr)
NvimTreeLineNr (LineNr) NvimTreeLineNr (LineNr)
NvimTreeVertSplit (VertSplit) [deprecated, use NvimTreeWinSeparator] NvimTreeWinSeparator (WinSeparator)
NvimTreeWinSeparator (VertSplit)
NvimTreeCursorColumn (CursorColumn) NvimTreeCursorColumn (CursorColumn)
There are also links for file highlight with git properties, linked to their There are also links for file highlight with git properties, linked to their

View File

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

View File

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

View File

@ -4,12 +4,6 @@ local events = require "nvim-tree.events"
local utils = require "nvim-tree.utils" local utils = require "nvim-tree.utils"
local log = require "nvim-tree.log" 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 = { M.View = {
adaptive_size = false, adaptive_size = false,
centralize_selection = false, centralize_selection = false,
@ -38,7 +32,7 @@ M.View = {
"CursorLine:NvimTreeCursorLine", "CursorLine:NvimTreeCursorLine",
"CursorLineNr:NvimTreeCursorLineNr", "CursorLineNr:NvimTreeCursorLineNr",
"LineNr:NvimTreeLineNr", "LineNr:NvimTreeLineNr",
get_win_sep_hl(), "WinSeparator:NvimTreeWinSeparator",
"StatusLine:NvimTreeStatusLine", "StatusLine:NvimTreeStatusLine",
"StatusLineNC:NvimTreeStatuslineNC", "StatusLineNC:NvimTreeStatuslineNC",
"SignColumn:NvimTreeSignColumn", "SignColumn:NvimTreeSignColumn",