You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems I really misconfigured dressing. Sorry for the trouble
After the above report I decided to test fzf-lua with dressing, to my surprise I saw the latest 2 commits (namely 9f9b773) and this comment:
-- Because fzf-lua doesn't call the on_choice function if exited (e.g. with <C-c>), we need to-- add an autocmd ourselves to make sure that happens.
This made no sense as I had written the code in the past in such a way that should call on_choice with nil when no item is selected.
Turns out, some time ago I added "dummy" actions (keybinds) for ctrl-c/esc (for better resume support) which in turn affected the code route I had setup before to call on_choice(nil, nil) when no item was selected. While I appreiate the innovative solution your commits 😄 I think it's better to also solve the original bug (on_choice must be called according to the docs):
Fixed in ibhagwan/fzf-lua@5474df3, the new code flow (I can probablly eliminate the if not selected route, left for posterity):
ifnotselectedthen-- with `actions.dummy_abort` this doesn't get called anymore-- as the action is configured as a valid fzf "accept" (thus-- `selected` isn't empty), see below comment for mor infoon_choice(nil, nil)
elseo._on_choice_called=nilactions.act(o.actions, selected, o)
ifnoto._on_choice_calledthen-- see comment above, `on_choice` wasn't called, either-- "dummy_abort" (ctrl-c/esc) or (unlikely) the user setup-- additional binds that aren't for "accept". Not calling-- with nil (no action) can cause issues, for example with-- dressing.nvim (#1014)on_choice(nil, nil)
endend``
The text was updated successfully, but these errors were encountered:
Hi @stevearc,
Context: ibhagwan/fzf-lua#1014
After the above report I decided to test fzf-lua with dressing, to my surprise I saw the latest 2 commits (namely 9f9b773) and this comment:
This made no sense as I had written the code in the past in such a way that should call
on_choice
withnil
when no item is selected.Turns out, some time ago I added "dummy" actions (keybinds) for
ctrl-c/esc
(for better resume support) which in turn affected the code route I had setup before to callon_choice(nil, nil)
when no item was selected. While I appreiate the innovative solution your commits 😄 I think it's better to also solve the original bug (on_choice
must be called according to the docs):Fixed in ibhagwan/fzf-lua@5474df3, the new code flow (I can probablly eliminate the
if not selected
route, left for posterity):The text was updated successfully, but these errors were encountered: