PatrickF1 / fzf.fish

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

[Search history] support selecting multiple commands #252

Closed acegallagher closed 2 years ago

acegallagher commented 2 years ago

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

PatrickF1 commented 2 years ago

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

acegallagher commented 2 years ago

There you go, requested changes made and committed

PatrickF1 commented 2 years ago

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 commented 2 years ago

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

acegallagher commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Thanks <3

PatrickF1 commented 2 years ago

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!

acegallagher commented 2 years ago

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.

PatrickF1 commented 2 years ago

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. :)