PatrickF1 / fzf.fish

🔍🐟 Fzf plugin for Fish
MIT License
1.96k stars 78 forks source link

multi select for history (ctrl+r) puts timestamps in front of all but the first command #251

Closed acegallagher closed 2 years ago

acegallagher commented 2 years ago

Before proceeding...

Describe the bug

ctrl+r and then tab to select multiple entries puts the timestamp in front of the entries, like:

selecting commands after selected

I imagine this is repeatable behavior for the package, but I'm happy to help debug of course if it's somehow only my setup. I'm also looking at the code now and trying to see if I could submit a pull request.

Environment

Versions installed: bat 0.21.0 (405e5f74) fd 8.4.0 fzf 0.31.0 (a0ef898) fish, version 3.4.1

Thanks much for putting together something so well thought out.

acegallagher commented 2 years ago

Ah yeah, I have a pull request, just needed to change a few lines. Here is the code snippet:

set -U commands_selected # empty list to loop over selected commands, in case multiple
for c in (string split \n $command_with_ts)
    set --append commands_selected (string split --max 1 " │ " $c)[2]
end
commandline --replace -- $commands_selected

Incoming!

PatrickF1 commented 2 years ago

Hi @acegallagher, the search history feature does not multi-select by default, so you must've configured it to be multi-selectable. What's your use case for selecting multiple commands?