Sublime Forum

ST3: FuzzyFileNav

#36

On another topic, I have a feature request. I have keep_panel_open_after_action set to false, because the vast majority of the time, I’m just looking for a file. But there are some actions after which it would be useful to keep it open, such as creating a new folder. I would like to be able to distinguish the useful cases from the non-useful cases, or have it done for me.

Another idea for a feature I had involves show_system_hidden_files. I have this set to true, but I don’t like looking at the long list of dotfiles in my home directory. But if I set it to false, I can’t actually select any of them. I would like to have a setting where those files are hidden unless you start searching with period.

Thanks, by the way, for such a fantastic plugin. I am a longtime emacs user, and I can’t stand using the file dialog for anything. FFN is the closest thing to emacs’ find-file that I’ve found so far.

0 Likes

#37

That’s the current ST3 version. Maybe you forgot to update your keymap file? FFN only ships with some example files. Do you have any errors in the console?

Alex

0 Likes

#38

I can look into to this. I don’t think it would be too difficult to add.

The setting is for the default behavior. You can toggle between the two with ctrl+h or super+h on mac. Triggering with dot only makes since on systems that use dot to distinguish hidden files; windows does not; therefore, in order to have a consistent interface, I have opted to use the toggle shortcut to quickly hide or show hidden files.

No problem. Glad you like it. I really on create plugins I actually use, but it is always nice to hear that others use them as well :smile:.

0 Likes

#39

@jsc I have added your feature request to have control over which actions to keep the panel open for. You can now exclude actions via the settings key below:

[pre=#2D2D2D] // Actions that can ignore the keep panel open settings
// Available actions: delete, open, saveas, mkfile, mkdir, paste
“keep_panel_open_exceptions”: “open”],[/pre]

I will backport to ST2 later.

0 Likes

#40

The new exceptions preference is perfect.

I couldn’t figure out what was going on with the repository, I think it was an issue with a cache somewhere. I was getting bad unzip errors. I blew away the whole ST3 directory and reinstalled from scratch, and it works fine now.

I can’t get super-h to toggle the hidden files, though.

EDIT: ah, I see what’s wrong. show_system_hidden_files needs to be false. If true, super+h doesn’t toggle. Seems like it should.

0 Likes

#41

I will take a look at this. I don’t think I meant it to work that way…

0 Likes

#42

Obviously, you know your own code better than I do, but just in case it might save you some time digging, I believe the issue is in line 694 of fuzzy_file_nav.py. Togging with super+h toggles ignore_excludes, but it does not impact show_hidden. There seems to be some unintended overlap between the meaning of “excluded” files (by regexp) and “hidden” files.

I’m not sure what the right resolution is. I want to be able to change showing and hiding all files, hidden and excluded, through toggle, but there doesn’t seem to be a clean way of doing it with just one toggle. Maybe keep super+h for toggling hide files and have another command to toggle excluded files? Or if it is easier, just change super+h to toggle show_hidden instead of ignore_excludes, since it is probably much rarer to want to load an excluded file than a hidden one.

0 Likes

#43

@jsc I think you should be happy with the recent change. The behavior for the toggling of hidden files is more consistent now. Not sure what my original reason was for doing it the way I was, but you should have no issues now.

So what this means is when a new FuzzyPanel session is opened, it will use the setting in you setting file, then any time during the session you can toggle back and forth and it will remember the state throughout that session (until quick panel session is officially exited/completed). Regex excluded files and hidden are now treated the same.

I will backport this to ST2 later.

0 Likes

#44

So, a few things. Trying to let Package Control automatically upgrade caused another corrupted mess that wouldn’t load. Whatever, I’ll manually pull updates until that’s fixed, probably a Package Control issue.

Secondly, your latest update, while having the admirable effect of allowing hidden file toggling no matter the initial setting of show_system_hidden_files, also has the side effect of ignoring the setting of show_system_hidden_files. I have tried it set to both true and false, and it always shows me hidden (and excluded) files on initial open.

Actually, now on more testing, that’s not exactly true. 1) I have it set to false, always shows hidden files; 2) I set it to true, still shows me hidden files; 3) I set it back to false, and now it works like I expect. Oh wait, now it’s back to showing me hidden files, although I haven’t changed anything. So it’s a bit hard to make it stick.

I think a sensible behavior might be to treat and excluded files exactly the same. That is, excluded files are just hidden files that were hidden by the user. Then use the hidden files setting to determine whether to open showing all files or just non-hidden ones.

0 Likes

#45

I had the logic backwards. It should be fixed now.

Whatever you have your settings file set to is the default when you open the fuzzy panel. You can toggle between hidden and not hidden during your session but when you have completed your action(s) and closed the panel, it is done. Next time you open a panel, it will use the default.

I am not sure what your other issues are…are you still having them now, if so, please explain because I don’t think I understand.

0 Likes

#46

That fixed it! Thanks. Works fine.

0 Likes

#47

I’m seeing this behavior where I lose the edit cursor and focus when I open a file using FFN. It doesn’t happen using the file dialog, and it doesn’t happen with FFN on ST2. Any time the panel is auto closed, such as when keep_panel_open_after_action is false, the cursor is gone and typing does nothing until you click somewhere.

0 Likes

#48

Try it now. Let me know if there are other odd quirks you stumble on.

0 Likes

#49

That seems to have fixed it.

0 Likes

#50

Another feature request: have make new file and make new directory recognize a slash or a backslash and create any necessary intermediate folders instead of saying it can’t be done.

0 Likes

#51

One quirk that is not really a big issue, but something that sticks out, is if you use super+s to save a file with a new name, the contents appear selected, as if you had done a select all or had copy and pasted the file contents.

0 Likes

#52

Yeah it is pretty minor, but I will take a look into it sometime soon and post back when it is resolved.

0 Likes

#53

Selections and scroll position are now preserved on save as.

0 Likes

#54

Okay, a crashing bug this time. When I try to overwrite a file with the contents of the current buffer, it hangs or crashes.

Hm, now I can’t reproduce it. I will let you know if I can.

0 Likes

#55

I just noticed that opening a file results in no cursor, meaning you have to click in the window to do anything. I didn’t notice this behavior before, maybe it’s new?

0 Likes