Skip to content

Commit

Permalink
fix(writer): Ensure all buffer namespaces are cleared
Browse files Browse the repository at this point in the history
...before setting highlights

Closes #38
  • Loading branch information
hedyhli committed Nov 25, 2023
1 parent dc0d37e commit 44fdeac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/outline/writer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function M.add_highlights(bufnr, hl_info, nodes)
end

---@param bufnr integer
local function clear_virt_text(bufnr)
vim.api.nvim_buf_clear_namespace(bufnr, vtns, 0, -1)
local function clear_all_ns(bufnr)
vim.api.nvim_buf_clear_namespace(bufnr, -1, 0, -1)
end

---@param bufnr integer
Expand Down Expand Up @@ -79,7 +79,7 @@ function M.make_outline(bufnr, items, codewin, find_node)
-- Deepest matching node to put cursor on based on hovered line
local put_cursor

clear_virt_text(bufnr)
clear_all_ns(bufnr)

---@type string[]
local lines = {}
Expand Down

0 comments on commit 44fdeac

Please sign in to comment.