fix: No-op keymaps when there is no provider

This commit is contained in:
hedy
2023-12-13 18:40:08 +08:00
parent 2dd9ea2f57
commit d073791f1c
3 changed files with 44 additions and 9 deletions

View File

@@ -191,7 +191,7 @@ function Preview:show()
return
end
if not vim.api.nvim_win_is_valid(self.s.code.win) then
if not vim.api.nvim_win_is_valid(self.s.code.win) or not self.s.provider then
return
end
@@ -296,6 +296,7 @@ function LivePreview:show()
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))
or not self.s.provider
then
return
end