From e76cb03c420bb74a5900a5b3e1dde776156af45f Mon Sep 17 00:00:00 2001 From: Christopher Lane Date: Tue, 2 Apr 2024 21:03:14 -0400 Subject: [PATCH] Fix error on item select: Missing length argument Addresses the following error resulting from not passing `length` param on line 170: ``` E5108: Error executing lua: ...kaze/.local/share/nvim/lazy/harpoon/lua/harpoon/list.lua:242: 'for' limit must be a number stack traceback: ...kaze/.local/share/nvim/lazy/harpoon/lua/harpoon/list.lua:242: in function 'resolve_displayed' ...makaze/.local/share/nvim/lazy/harpoon/lua/harpoon/ui.lua:170: in function 'select_menu_item' ...ze/.local/share/nvim/lazy/harpoon/lua/harpoon/buffer.lua:21: in function 'run_select_command' ...ze/.local/share/nvim/lazy/harpoon/lua/harpoon/buffer.lua:61: in function <...ze/.local/share/nvim/lazy/harpoon/lua/harpoon/buffer.lua:60> ``` --- lua/harpoon/ui.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/harpoon/ui.lua b/lua/harpoon/ui.lua index 30ddfe65..900b3149 100644 --- a/lua/harpoon/ui.lua +++ b/lua/harpoon/ui.lua @@ -167,7 +167,8 @@ function HarpoonUI:select_menu_item(options) -- must first save any updates potentially made to the list before -- navigating local list = Buffer.get_contents(self.bufnr) - self.active_list:resolve_displayed(list) + local length = #list + self.active_list:resolve_displayed(list, length) Logger:log( "ui#select_menu_item selecting item",