Skip to content

Commit 7ffd82a

Browse files
Validate buffer window to avoid errors on unloaded buffers when toggling
1 parent 41b955c commit 7ffd82a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/render-markdown/ui.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ M.clear_valid = function(buf)
5353
if not vim.api.nvim_buf_is_valid(buf) then
5454
return false
5555
end
56+
if util.buf_to_win(buf) < 0 then
57+
return false
58+
end
5659
if not vim.tbl_contains(state.config.file_types, vim.bo[buf].filetype) then
5760
return false
5861
end

0 commit comments

Comments
 (0)