Skip to content

Commit

Permalink
fix(sources-markdown): check buffer validity, close #114
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Dec 2, 2023
1 parent 3b7978b commit 9885b34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/dropbar/sources/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ setmetatable(markdown_heading_buf_symbols, {
---@param incremental? boolean incremental parsing
---@return nil
local function parse_buf(buf, lnum_end, incremental)
if not vim.api.nvim_buf_is_valid(buf) then
markdown_heading_buf_symbols[buf] = nil
return
end
local symbols_parsed = markdown_heading_buf_symbols[buf]
local lnum_start = symbols_parsed['end'].lnum
if not incremental then
Expand Down

0 comments on commit 9885b34

Please sign in to comment.