fix: Ignore special buffers, fix auto-preview and not focus_on_open

This commit is contained in:
hedy
2023-11-30 10:17:00 +08:00
parent 4bbecbb92e
commit a5411b0a0c
3 changed files with 21 additions and 17 deletions

View File

@@ -191,6 +191,10 @@ function Preview:show()
return
end
if not vim.api.nvim_win_is_valid(self.s.code.win) then
return
end
if not self.buf or not self.win then
self:create()
else
@@ -289,6 +293,11 @@ function LivePreview:show()
return
end
if not vim.api.nvim_win_is_valid(self.s.code.win)
or (self.codewin and not vim.api.nvim_win_is_valid(self.codewin)) then
return
end
local node = self.s:_current_node()
if not node then
return