fix: safer teardown of buffer previewer (#1158)
This commit is contained in:
@@ -921,6 +921,7 @@ previewers.buffers = defaulter(function(opts)
|
|||||||
return state
|
return state
|
||||||
end,
|
end,
|
||||||
teardown = function(self)
|
teardown = function(self)
|
||||||
|
if self.state then
|
||||||
-- reapply proper buffer-window options..
|
-- reapply proper buffer-window options..
|
||||||
for opt, value in pairs(self.state.win_options) do
|
for opt, value in pairs(self.state.win_options) do
|
||||||
vim.api.nvim_win_set_option(self.state.winid, opt, value)
|
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)
|
vim.api.nvim_buf_clear_namespace(buf, ns_previewer, 0, -1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
previewer_active = false
|
previewer_active = false
|
||||||
end,
|
end,
|
||||||
dyn_title = function(_, entry)
|
dyn_title = function(_, entry)
|
||||||
|
|||||||
Reference in New Issue
Block a user