Skip to content

Commit 99c23c3

Browse files
committed
chore: replace deprecated neovim API
1 parent 11c9e91 commit 99c23c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/nvim-web-devicons/hi-test.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---Run a test similar to :so $VIMRUNTIME/syntax/hitest.vim
22
---Display all icons and their group highlighted, followed by the concrete definition
33

4-
local namespace_hi_test_id = vim.api.nvim_create_namespace("NvimWebDeviconsHiTest")
4+
local namespace_hi_test_id = vim.api.nvim_create_namespace "NvimWebDeviconsHiTest"
55

66
---@class (exact) IconDisplay for :NvimTreeHiTest
77
---@field tag string filename, os or extension
@@ -47,8 +47,8 @@ function IconDisplay:render(bufnr, max_tag_len, max_group_len, l)
4747
local text = string.format(fmt, self.icon, self.tag, self.group, self.def)
4848

4949
vim.api.nvim_buf_set_lines(bufnr, l, -1, true, { text })
50-
if vim.fn.has("nvim-0.11") == 1 and vim.hl and vim.hl.range then
51-
vim.hl.range(bufnr, namespace_hi_test_id, self.group, { l, 0 }, { l, -1, }, {})
50+
if vim.fn.has "nvim-0.11" == 1 and vim.hl and vim.hl.range then
51+
vim.hl.range(bufnr, namespace_hi_test_id, self.group, { l, 0 }, { l, -1 }, {})
5252
else
5353
vim.api.nvim_buf_add_highlight(bufnr, -1, self.group, l, 0, -1) ---@diagnostic disable-line: deprecated
5454
end

0 commit comments

Comments
 (0)