Skip to content

Commit 920daeb

Browse files
mpluspclaude
andcommitted
fix: Fix number key selection in PackMenu
The menu's number key selection wasn't working due to incorrect loop termination logic. Fixed by using explicit break statements when a valid selection is made or when exit keys (q/Esc) are pressed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a42c2fc commit 920daeb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/pack-manager/ui.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,13 @@ function M.menu()
338338
local selected = key - string.byte('0')
339339
if selected <= #menu_options then
340340
result = menu_options[selected].action
341+
break
341342
end
342343
elseif key == 27 or key == string.byte('q') then -- Escape or q
343344
result = nil
345+
break
344346
end
345-
until result ~= nil or result == nil and (key == 27 or key == string.byte('q'))
347+
until false
346348

347349
close_window(win)
348350
return result

0 commit comments

Comments
 (0)