-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Toggle hidden files in file picker #7846
Comments
I am not in favor of adding these bindings at all. Hidden files specifically can be enabled in your cinfig and you can use negative matches to remove them if they are needed. There are about 5 settings that ci tril which fukes are hidden from the picker. Should we really have a picker krybindjng for all if them? I also don't see the usecase if tiggeling these while the licker is Olen. You can simply Implementation wise any implementation should wait for #7814. That PR enables all oicmers to stream in matches and also makes the file picker run in background. That atleast alleviates the file limit and the concern about slowness if crawling hidden files (which is signicant). But I still don't think this should have dedicated picker keybindings over just using Thus could be to add as an optionak binding once #5505 is resolved but U don't think we should add 5 different binding to the oikcer by default (or choose inky one iof them) |
not sure if we do need this but my preferred solution would be one keybinding/command to rewalk the directory and then #5505 for custom keybindings to toggle each |
Ah it seems there was a new discussion. I thought you came from the old one. In that case duplicate of #7712 |
Yeah that's reasonable but any implementation needs to wait until #5505 is resolved (potentially quite a while away) |
Ah #5505 seems very nice and yes it would be good to wait for that |
How would you use negative matches for getting rid of hidden files? |
You can enable hidden files and then make the fuzzy matter filter them. Nucleo (the new fuzzy matcher) will be fast enough to make this always practical altough it works on mater too |
I feel like that is something worthy of being in the docs |
Not necessarily in the docs, thoseare supposed to be a concise technical manual but it would be a good fit for the communicrt wiki |
Just realized something (didn't know where else to comment this), if a directory has more than 100,000 files, even if someone hides the hidden files with |
Once #7814 is merged we won't be limited to 1000 files anymore because the walker results are streamed to the fuzzy matcher we don't need to limit the amount of files anymore |
Following discussion #7291.
I think it would be really nice to be able to toggle hidden files, not just for the reasons mentioned above, but also because for large directories (
~
), there is a 100,000 limit for the number of files, and I had a situation where I had quite a lot of hidden files, and was not able to find my non-hidden files without turning this off in my config. Edge case example I guess: the things mentioned in #7291 make sense to me.I think behavior could be something like this:
ctrl + h
or something like that) is equivalent to togglinghidden
under[editor.file-picker]
, but it updates at runtime inside the file pickerctrl + h
, but more files "fill up" around it (not sure where the selected file will actually be on the screen...)Implementation wise, this might be a bit awkward since
WalkBuilder
from theignore
crate is being used as soon as the file picker is opened. Ifhidden
is set totrue
, then it will bring in all of the files that are not hidden, and no more. It will then use these files as a basis for the file picker.This sort of presents a problem: If
hidden
is set to true by default, and we want to be able to toggle hidden files, we either have to manually bring in hidden files (bad), rebuild theWalk
iterator and get the files again (also bad), or 2 other things that I can think of. 1 option is to build anotherWalkBuilder
and carry two vectors of files around, which shouldn't introduce that much overhead unless the file is really large.A better option, and one that I think could work well with low overhead, is to tag each file path in the vector with hidden or unhidden, so that we only carry around 1 vector of paths (either as a tuple with a bool flag or an enum). Build two
WalkBuilder
, one with hidden set to true and the other false, and depending on their diffs mark a path as hidden or unhidden (could use theiter_diff
crate here for this). Whenctrl + h
or similar is pressed, we just setmatches
inPicker
accordingly. Even with 100,000 files in one of those iterators this should be low overhead. It even presents a nice additional feature: if 100,000 files are in the file picker, we can prioritize the ones that are not hidden.I'd love to give this implementation a go, but if the behavior above seems ridiculous to people, I'd like to hear that before working on it.
The text was updated successfully, but these errors were encountered: