chore: add guards to prepare setup refactoring
This commit is contained in:
@@ -371,7 +371,7 @@ end
|
||||
local M = {}
|
||||
|
||||
function M.draw()
|
||||
if not TreeExplorer or not api.nvim_buf_is_loaded(view.View.bufnr) then
|
||||
if not TreeExplorer or not view.View.bufnr or not api.nvim_buf_is_loaded(view.View.bufnr) then
|
||||
return
|
||||
end
|
||||
local cursor
|
||||
@@ -404,7 +404,7 @@ function M.draw()
|
||||
end
|
||||
|
||||
function M.render_hl(bufnr)
|
||||
if not api.nvim_buf_is_loaded(bufnr) then return end
|
||||
if not bufnr or not api.nvim_buf_is_loaded(bufnr) then return end
|
||||
api.nvim_buf_clear_namespace(bufnr, namespace_id, 0, -1)
|
||||
for _, data in ipairs(hl) do
|
||||
api.nvim_buf_add_highlight(bufnr, namespace_id, data[1], data[2], data[3], data[4])
|
||||
|
||||
Reference in New Issue
Block a user