fix: adding a nil check to self.state when the window is too narrow for a preview (#110)

This commit is contained in:
Fahad RIaz
2020-09-23 00:19:14 -04:00
committed by GitHub
parent 8f8d6563c0
commit 7015596711

View File

@@ -241,7 +241,7 @@ previewers.vim_buffer = defaulter(function(_)
setup = function() return { last_set_bufnr = nil } end,
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)
end
end,