Sublime Forum

ST3: FuzzyFileNav

#66

I don’t get where’s the problem is ?
If I run the plugin, select an unopened file and hit ESC, I have the focus on the beginning of the file.
Is it related to OS ?

startup, version: 3035 windows x64 channel: dev

0 Likes

#67

Quite possibly related to OS.

I’m on linux usually. Will try now on this OSX [size=50]piece of crap[/size] wonderful device

0 Likes

#68

Having same problems with my plugin on OSX [size=50]piece of crap[/size] device

@Bizoo

Does the command you are referring to alter the selection in any way?

0 Likes

#69

[quote=“castles_made_of_sand”]Having same problems with my plugin on OSX [size=50]piece of crap[/size] device

@Bizoo

Does the command you are referring to alter the selection in any way?[/quote]

I only tried to reproduce the problem with FuzzyFileNav plugin, which run the following code:

# Open file new_view = self.window.open_file(self.cls.cwd) if new_view is not None: self.window.focus_view(new_view)
So no the selection is not modified.

Sorry, I didn’t understand that it was related to the modifying selection.

0 Likes

#70

@Bizoo

Yeah, I don’t know, haven’t really followed this thread entirely.

My plugin I’m experiencing problems with navigates to a section in the file, making a new selection.

If FuzzyNav doesn’t alter selection ( why would it I guess ? ) and you are having focus problems, it could be due to layout split groups. If I recall correctly window.focus_view(v) only focuses a view in a given group, yet you still have to call window.focus_group(i)

0 Likes

#71

Calling focus_group makes no difference.

The only way I have been able to get focus so far is to do something like this (which is horribly ugly):
[pre=#252525] multi = (
bool(sublime.load_settings(FUZZY_SETTINGS).get(“keep_panel_open_after_action”, False)) and
“open” not in sublime.load_settings(FUZZY_SETTINGS).get(“keep_panel_open_exceptions”, ])
)
new_view = self.window.open_file(self.cls.cwd)
if new_view is not None:
def fun(v, multi):
self.window.focus_view(v)
if not multi:
self.window.run_command(“show_panel”, {“panel”: “console”})
self.window.run_command(“hide_panel”, {“cancel”: True})
sublime.set_timeout(lambda: fun(new_view, multi), 500)
# sublime.set_timeout(lambda: self.window.focus_view(new_view), 500)[/pre]

I basically have to wait till the quick panel closes and then force a panel to open and close to trigger the refocusing…this is ugly and stupid. I shouldn’t have to do this kind of stuff.

0 Likes

#72

lol, yeah I just got used to showing the goto line dialogue manually

I can live with hacky for an editor plugin :smile: I think I’ll do the same in mine for the moment.

0 Likes

#73

Since I don’t want to mess with closing people’s output/console panels that are up, I found that opening and closing a quickpanel to be more acceptable and less intrusive:

[pre=#141414] def fun(v, multi):
v.window().focus_view(v)
if not multi:
v.window().show_quick_panel(“None”], None)
v.window().run_command(“hide_overlay”)
sublime.set_timeout(lambda: fun(new_view, multi), 500)[/pre]

0 Likes

#74

@jsc, the fix is now in. Let me know if that works for you.

0 Likes

#75

It seems to have worked.

Do you monitor this thread manually? Is there any way to get an email alert when there is a new response?

Does the Sublime Text developer ever show up in these forums? It would be good to draw his attention to some of these niggling issues in new releases.

0 Likes

#76

It looks like you’re on a coding spree again, so I’ve come out of the woodwork to ask again:

Any chance of implementing a “proper” save? By which I mean using FuzzyFileNav instead of my OSs “Save As…” dialog.

Alex

0 Likes

#77

@quodlibet, yeah, I am on a bit of a coding spree. Squashing a couple of bugs here and there, and pushing out some personal plugins that have been sitting in my settings folder (at least the stable ones).

As for your “Save As…” request, I will take a look again. If I do it, it can’t replace the built-in save completely, and it may not work with on save, pre-save events. I need to dig into it again. I have a couple of bugs and features that are on my list to get done before I burn out, so we shall see what I get to :wink:.

0 Likes

#78

For the record, this is what I have in mind:

  • Save
    • If saved, save.
    • If unsaved, popup FuzzyNav, filled in with contents of first line (up to a certain number of characters, probably) + default syntax extension (if other than Plain Text)
  • Save As
    • Popup FuzzyNav, filled in with current name, or as above if unsaved

This seems to cover most cases (?). (Or maybe not. It’s a little late and I’m not thinking all that clearly.)

The above setup seems feasible to me if you provide new commands to bind Ctrl+S and Ctrl+Shift+S to. Or perhaps you can interfere with on_command with some setting to toggle it?

I’m not sure how you’d handle the “current directory” for unsaved files. Sublime uses the directory of the file from which you opened the new file/tab (I think.) Is this information available for you to use? Opening FuzzyNav on an unsaved file is a always a little surprising.

Something else: Is there a binding I can set to open multiple files? I mean regardless of the keep_panel_open_exceptions setting. I’d like to set Alt+Right (or something) to open a file without closing FuzzyNav, mimicking the palette’s right arrow functionality.

Alex

Edit: would you prefer these in GH’s issues?

0 Likes

#79

Github issues are more likely to prompt me to do something. I say things in this forum that I often forget.

I honestly approach issues with no pressure. I haven’t cracked down and disabled filing issues to encourage pull requests, but I basically approach it by leaving issues open that I think I might do one day…and one day if I feel like it, and no one else has opted to do it for me, I do it :smile:. Github issues helps me remember what issues or requests I haven’t turned down…sometimes I go dark for months at a time, and when I poke my head out again, I barely remember what it is I was going to do.

0 Likes

#80

FuzzyFileNav will now display the current working directory in the status bar as long as the quick panel is open. A number of people have complained they get lost when navigating, this should now allow everyone to always know where they are at :wink:.

0 Likes

#81
  • FuzzyFileNav will now allow you to use the right arrow to open multiple files just like the built in palette (regardless of whether you have the “keep_panel_open_after_action” set or not).
  • Sidebar menu support (not sure why I haven’t added this sooner :smile:)
0 Likes

#82

Sorry, small additional fix. Sidebar option introduced unexpected scenario where a FuzzyFileNav Command can be launched while a FuzzyFileNav panel was still open putting the plugin in a weird state. This should now be resolved.

0 Likes

#83

Right arrow to open files is not working for me – not sure why. I must be missing blatantly obvious.

0 Likes

#84

@quodlibet, any errors in the console? I tried this in Windows in OSX and it works fine. Linux should be no different.

You, know what it might be? Try auditing what commands are getting launched by logging commands. Maybe another plugin that is doing some clever stuff with cursor movement and is hijacking the “right” key, but not excluding the functionality in widgets.

0 Likes

#85

Man, I don’t know what to tell you, but it’s working now. :question: It works great – thank you! The CWD is also a nice touch (it also wasn’t working).

My guess is that the package didn’t update properly on account of the very shoddy way I share Packages (not just User) across OSs. Maybe.

I also closed the github issue.

0 Likes