Sublime Forum

FuzzyFileNav Plugin (on package control...finally)

#21

I figured it was something like that, as you are very consistent in that regard. I’ve done a quick trace of the methods (because I’m curious too and giving you the most information will probably make the bug, if it exists, easier to fix).

I think the path getting passed to get_files(), well initially the “fuzzy_file_nav” command, is “C:”. os.listdir() is then called on this, which is where things don’t happen like one would expect. When you enter “C:” as the path, the “start” variable already contains the slash (“C:”)

Well with that, I don’t think there is any more information I can think of off the top of my head to help reproduce the issue. I’ll check back tomorrow though, so let me know if there’s anything I can clarify.

0 Likes

#22

There is something wrong. I want to say this is new. Slash took me to the Windows System32 folder which makes no sense.

0 Likes

#23

My notes say slash should show all drives not the root of the drive. You were correct in your assessment that I access the root of the drive via (c:\ or c:/ not / or ); I didn’t realize that :smile:.

I should have a fix soon.

0 Likes

#24

Never mind, it was only supposed to show all drives when the root drive could not be found. I updated the branch to fix this issue. It should now accept / or \ like the windows cmd prompt does. Thanks for reporting this issue @skuroda. get_drives was a different part of the code that generates drives right before I append slashes to all folders/drives. FuzzyFileNav should of accepted the drive with the slash not without.

0 Likes

#25

Nix style path complete is in. To get true nix style path complete, also enable case-sensitivity…but if you are on windows, probably leave that out.

It still isn’t quite there. It only matches a file when only one file matches instead of updating the string with the max shared chars. I will add that later.

0 Likes

#26

Okay, full nix path completion is now in. I have to get some real work done, so that is it for now. Report bugs here, or issue pull requests.

0 Likes

#27

Glad you could reproduce the bug. Also, wow that was faster than I expected. Guess I don’t have to use my hack-y implementation of nix file completion. Thanks for the update. Have fun with your real work! :smiley:

0 Likes

#28

Unix/Linux case_sensitive setting has been removed. If you set the new setting nix_style_path_complete to true the auto-complete will use case sensitivity since this method of auto-complete will not work reliably with insensitive case. And if you use the windows method of auto-complete by setting nix_style_path_complete to false, Linux/Unix will use case insensitive (since you can just tab through the actual files, case sensitivity is a non issue here). This makes it less confusing in the settings file, and more reliable when using.

0 Likes

#29

Hi facelessuser, thank you for your great plugin :smiley: btw, how can I open a folder in nav panel ? (I mean select folder and its content is displayed on the sidebar, I want to add that folder to Project ^^ )

0 Likes

#30

Currently it only does copy, cut, paste, delete, create files and folders. It also can do a “save as” operation on files.

Adding a folder to a project could be added, but Jon has not really provided a reasonable way to access the project file via the ST2 API. You have do some really odd things just to find the project file. I did a little of this in my “Favorite Files” plugin just to locate where the project file was stored so I could store a project specific settings file with the project file…it was ridiculous… That doesn’t even account for adding folders to a project file that does not exist on disk yet. For me to add support for adding the folder to a project, Jon really needs to expose that access in the API first. It is just a big headache to add it with the current API.

0 Likes

#31

Out of curiosity, is this why FuzzyFileNav seems to open a project file as text rather than as a project? I’ve noticed that that’s something my machine does a lot and at seeming random, so it’d be great if there were a way to coerce the plugin to load a complete project when it encountered one. It works so beautifully that I give a tiny, pained little groan every time I find myself back in an OS X file navigation panel.

0 Likes

#32

[quote=“phyllisstein”]

Out of curiosity, is this why FuzzyFileNav seems to open a project file as text rather than as a project? I’ve noticed that that’s something my machine does a lot and at seeming random, so it’d be great if there were a way to coerce the plugin to load a complete project when it encountered one. It works so beautifully that I give a tiny, pained little groan every time I find myself back in an OS X file navigation panel.[/quote]

FuzzyFileNav just sends the file to the ST2 “open file” API command. ST2 always chooses to open project files as text opposed to opening them as actual projects. I haven’t looked into whether there is a way via the API to open a project as a project if you know where the project file is…I may take a look into it, but I won’t promise anything.

0 Likes