refacto: buffer management, setup fixes, autocmd fixes (#967)

This commit is contained in:
Kiyan
2022-02-14 19:16:45 +01:00
committed by GitHub
parent 3f4ed9b6c2
commit 6da7467944
11 changed files with 377 additions and 379 deletions

View File

@@ -25,7 +25,7 @@ local sign_names = {
local signs = {}
local function add_sign(linenr, severity)
local buf = view.View.bufnr
local buf = view.get_bufnr()
if not a.nvim_buf_is_valid(buf) or not a.nvim_buf_is_loaded(buf) then return end
local sign_name = sign_names[severity][1]
table.insert(signs, vim.fn.sign_place(1, 'NvimTreeDiagnosticSigns', sign_name, buf, { lnum = linenr+1 }))
@@ -114,7 +114,7 @@ function M.update()
if #signs then
vim.fn.sign_unplacelist(vim.tbl_map(function(sign)
return {
buffer = view.View.bufnr,
buffer = view.get_bufnr(),
group = "NvimTreeDiagnosticSigns",
id = sign
}