fzf.fish icon indicating copy to clipboard operation
fzf.fish copied to clipboard

[Search history] support selecting multiple commands

Open acegallagher opened this issue 2 years ago • 9 comments

Resolves https://github.com/PatrickF1/fzf.fish/issues/251. Reply the issue I opened, here's the minor change. It's a big deal for my workflow to be able to cobble together scripts this way.

Hopefully it's helpful! Thanks

acegallagher avatar Aug 03 '22 23:08 acegallagher

Gotcha, that makes sense. I can see myself--though rare--selecting multiple commands to run. Okay I'll work on this.

PatrickF1 avatar Aug 03 '22 23:08 PatrickF1

There you go, requested changes made and committed

acegallagher avatar Aug 03 '22 23:08 acegallagher

Thank you! So...a complication is that this doesn't work when you select a multi line command. I'll look into a solution when I have a significant contiguous chunk of free time some time later. But feel free to suggest ideas or fix it yourself.

PatrickF1 avatar Aug 03 '22 23:08 PatrickF1

Btw how do you comment and commit using two different GH accounts?

PatrickF1 avatar Aug 03 '22 23:08 PatrickF1

Ohhhhhhhhhhhh. There will have to be some sort of regex that only removes the date if present. Hilariously, the multi-account was unintentional. It's because I made the commit with an ssh key shared by both accounts (changed the key for one of them without thinking about it). Oops.

acegallagher avatar Aug 04 '22 00:08 acegallagher

Alright, there's a solution. It will strip the date from any line the date exists by regex. I suppose there's potentially some conflict if there's a line that also has the exact format of the date but I have no idea how much that would matter to you. It wouldn't to me.

acegallagher avatar Aug 04 '22 01:08 acegallagher

The regex now only matches the beginning of the string and no need for the if statement. Much cleaner. Also added multi!

Thanks <3

acegallagher avatar Aug 04 '22 06:08 acegallagher

Thanks for putting in the work, Michael. I'll take it from here--just gotta update the readme and add a test and I'll merge!

PatrickF1 avatar Aug 04 '22 16:08 PatrickF1

No problem. Congratulations on having a readable well built project that's very useful. Will continue looking through the code and imagining other ways to contribute.

acegallagher avatar Aug 05 '22 18:08 acegallagher

Great work Michael! Thank you for your mind words. Would you mind starring my repo? It's a goal of mine to reach 1k stars. :)

PatrickF1 avatar Aug 08 '22 00:08 PatrickF1