From 13880a33737e901b066348585ac04405a7ae08f3 Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Sat, 13 Apr 2024 18:37:52 -0700 Subject: [PATCH] fix: clear biscuits before has_nodes so that deleting a line actually removes the biscuit for that line --- 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,