From ce38a7fbff8792968b92f5fa121d6383e854e8a7 Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Sat, 13 Apr 2024 18:38:27 -0700 Subject: [PATCH] fix: clear biscuits before has_nodes so that deleting a line actually removes the biscuit for that line (#51) --- lua/nvim-biscuits/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/nvim-biscuits/init.lua b/lua/nvim-biscuits/init.lua index 70c68a5..7b0839c 100644 --- a/lua/nvim-biscuits/init.lua +++ b/lua/nvim-biscuits/init.lua @@ -68,6 +68,9 @@ nvim_biscuits.decorate_nodes = function(bufnr, lang) local children = {} local has_nodes = true + vim.api.nvim_buf_clear_namespace(bufnr, biscuit_highlight_group, + 0, -1) + while has_nodes do for index, node in ipairs(nodes) do children = utils.merge_arrays(children,