Skip to content

Commit

Permalink
Fix error on item select: Missing length argument
Browse files Browse the repository at this point in the history
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>
```
  • Loading branch information
Makaze authored Apr 3, 2024
1 parent 4ad05be commit e76cb03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/harpoon/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e76cb03

Please sign in to comment.