code
code copied to clipboard
Add fuzzy-finder-like open
From Launchpad bug 1547620:
Atom has a great built-in "fuzzy-finder" when you hit Ctrl+T. It opens a crazy-fast search through the open projects' filenames and when you hit enter, it opens that one in a new tab. It's a great way to insanely-quickly jump around in a large project.
I'd love to see something similar in Scratch. :)
Their plugin is here: https://github.com/atom/fuzzy-finder
I would be interesting in tackling this one. Couple questions though:
Would this be better as a plugin, or as part of the core code? Atom has it as a plugin with config options.
Atom tries to use ripGrep under the hood when possible. I've set up vim to use fzf and ag for the searching. Should we have options for which util to use under the hood?
I would default to using find though.
If Code is anything like Files then there are problems assigning a short-cut to a plugin. Maybe better as part of the code under the Scratch.FolderManager namespace?
@ssedrick Providing an option to choose a searching util is probably not something that needs to be exposed to the user—not according to the HIG at least. It's both simpler and more user-friendly to pick one that integrates well, and use that.
Out of curiosity, is anyone still looking at this issue? If not, I would be willing to take a look into this file search functionality!
I haven't been able to get anywhere with this, so if you want to take it, @CodeforEvolution, please do.
Cool! In that case, I believe there will be some necessary UI adjustments as a part of this ticket.
Otherwise, here is what I had in mind:
- I would like to make use of the pre-existing toolbar that drops down for text searches.
- The toolbar would now have two modes that a user could "toggle" between, using a special toggle switch. (Edit: I hope to have a concept image done soon!):
- The toggle switch would lie on the far left of the toolbar.
- The toggle switch's knob would have a magnifying glass graphic on it.
- The "slots" of the toggle switch would have graphics for each mode: A "bolded T" for text searching, and a "page" for file searching.
- When the knob hovers over one of these icons, the icon is highlighted, and the magnifying glass and specific mode icon are "merged"/shown on top of one another.
- Since "Ctrl+F" currently opens the text search toolbar, I feel that "Ctrl+Shift+F" could be a "logical candidate" to open the toolbar and switch to the file search mode immediately.
- When a user starts searching for a file, the sidebar on the left could expand slightly, and slowly eliminate entries that don't fit the search parameters that the user has started to type in.
Feel free to give feedback on this idea! (I'll wait on the coding until I have gotten a sufficient amount, just to be safe!)
+1 to using CtrlShiftF for the shortcut (unless it conflicts with something else), simply because that's what VS Code users are used to.
IMO Ctrl+P would be more logical as this is the shortcut for fuzzy-searching file names in VSCode, Atom, and Google Chrome / Firefox dev tools; Ctrl+Shift+F makes more sense for finding text across files.
Note: I've removed the mentions of a bounty since we have moved away from Bountysource and refunded all bounties as of June.
It's been a while since there's been activity in the existing pull request for this issue.
Would it be okay if a new pull request (created by someone else) was created that includes the changes from #1159?
@colinkiama Yes, as the original person did not respond to my last message I think it is OK to take this over if you wish.