geksilla/atom-fuzzy-grep

Feature: Persist search pattern

ineu opened this issue · 8 comments

ineu commented

In built-in Atom's fuzy-finder there's an option called 'Preserve last search'. As fuzzy-finder is not capable of opening multiple files at once, this option can be handy to go though all matches one by one. It would be nice to have the same feature in fuzzy-grep, so user won't need to fall back to ctrl-shift-f when he expects multiple matches.

@ineu make sense. What about by hitting Tab open file to preview in new tab, repeatedly Tab hits will change source for opened tab based on selected item.
Alt+Enter to persist file in new tab. Thanks.

ineu commented

So alt+enter opens file, keeping grep dialog open? Sounds fine.
Still it would be fine to save/restore search string, as it may be desirable to open some files, close dialog and after some work reopen it with the same search string.

@ineu both described scenarios will keep grep dialog opened. As quick fix I can implement, or if you want send PR, opening dialog with last searched string.

ineu commented

Ok, will try to implement this thing. Good occasion to learn something about Atom plugins )

@ineu, I've commited first part of the feature. Few things there:

  • New option Preserve Last Search if you want to always use last search string.
  • New method to open dialog with last search string entered. You can bind this method in your keymap.json file, for example:
'atom-workspace':
  'ctrl-alt-shift-g': 'fuzzy-grep:toggleLastSearch'

Or check Preserve Last Search option in package Settings.

You can try new changes by clone this repo and link it your packages. Thanks.

@ineu, released new version with this feature. You can update the package.
I leave this issue opened. Will track preview and cycle opening features here.

ineu commented

@geksilla Works great, thank you

@ineu, yw. thanks for great request!