fix lsp diagnostics highligth: find_node index, bufnr (#295)

This commit is contained in:
Dmitriy
2021-04-15 00:03:25 +03:00
committed by GitHub
parent ed6971d88a
commit 5c339e5a00
2 changed files with 3 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ local function get_severity(diagnostics)
end
local function highlight_node(node, linenr)
local buf = require'nvim-tree.lib'.Tree.bufnr
local buf = require'nvim-tree.view'.View.bufnr
if not vim.fn.bufexists(buf) or not vim.fn.bufloaded(buf) then return end
local line = a.nvim_buf_get_lines(buf, linenr, linenr+1, false)[1]
local starts_at = vim.fn.stridx(line, node.name)

View File

@@ -76,9 +76,10 @@ function M.find_node(nodes, fn)
local n, idx = M.find_node(node.entries, fn)
i = i + idx
if n then return n, i end
end
else
i = i + 1
end
end
return nil, i
end