fix: safer teardown of buffer previewer (#1158)

This commit is contained in:
fdschmidt93
2021-08-23 20:20:41 +02:00
committed by GitHub
parent f45c170f28
commit 50e5e86ac3

View File

@@ -921,6 +921,7 @@ previewers.buffers = defaulter(function(opts)
return state
end,
teardown = function(self)
if self.state then
-- reapply proper buffer-window options..
for opt, value in pairs(self.state.win_options) do
vim.api.nvim_win_set_option(self.state.winid, opt, value)
@@ -932,6 +933,7 @@ previewers.buffers = defaulter(function(opts)
vim.api.nvim_buf_clear_namespace(buf, ns_previewer, 0, -1)
end
end
end
previewer_active = false
end,
dyn_title = function(_, entry)