fix: adding a nil check to self.state when the window is too narrow for a preview (#110)
This commit is contained in:
@@ -241,7 +241,7 @@ previewers.vim_buffer = defaulter(function(_)
|
|||||||
setup = function() return { last_set_bufnr = nil } end,
|
setup = function() return { last_set_bufnr = nil } end,
|
||||||
|
|
||||||
teardown = function(self)
|
teardown = function(self)
|
||||||
if self.state.last_set_bufnr then
|
if self.state and self.state.last_set_bufnr then
|
||||||
vim.api.nvim_buf_clear_namespace(self.state.last_set_bufnr, previewer_ns, 0, -1)
|
vim.api.nvim_buf_clear_namespace(self.state.last_set_bufnr, previewer_ns, 0, -1)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user