Skip to content

Commit 562593a

Browse files
Bekabooibhagwan
authored andcommitted
fix: selected is nil if its number is padded
1 parent 755d9e6 commit 562593a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/fzf-lua/providers/ui_select.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end
4848

4949
M.accept_item = function(selected, o)
5050
if #selected == 0 then return end
51-
local idx = selected and tonumber(selected[1]:match("^(%d+)%.")) or nil
51+
local idx = selected and tonumber(selected[1]:match("^%s*(%d+)%.")) or nil
5252
o._on_choice(idx and o._items[idx] or nil, idx)
5353
o._on_choice_called = true
5454
end

0 commit comments

Comments
 (0)