Skip to content

Commit

Permalink
fix(symbol): use private data to check for menu
Browse files Browse the repository at this point in the history
Avoids triggering lazy-loading of fields when deleting menus.

closes #114
  • Loading branch information
willothy committed Dec 3, 2023
1 parent f54d926 commit cd26dc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lua/dropbar/bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ end
---Delete a dropbar symbol instance
---@return nil
function dropbar_symbol_t:del()
if self.menu then
self.menu:del()
if self._.menu then
self._.menu:del()
end
end

Expand Down
4 changes: 0 additions & 4 deletions lua/dropbar/sources/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ 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 cd26dc1

Please sign in to comment.