Home Download Buy Blog Forum Support

ST3: FuzzyFileNav

Re: ST3: FuzzyFileNav

Postby facelessuser on Tue May 21, 2013 4:47 pm

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):
                    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)


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.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: FuzzyFileNav

Postby sublimator on Tue May 21, 2013 6:08 pm

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

I can live with hacky for an editor plugin :) I think I'll do the same in mine for the moment.
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3: FuzzyFileNav

Postby facelessuser on Wed May 22, 2013 2:22 pm

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:

                        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)
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: FuzzyFileNav

Postby facelessuser on Wed May 22, 2013 2:26 pm

@jsc, the fix is now in. Let me know if that works for you.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: FuzzyFileNav

Postby jsc on Thu May 23, 2013 2:53 am

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.
jsc
 
Posts: 23
Joined: Wed Feb 20, 2013 2:24 am

Re: ST3: FuzzyFileNav

Postby quodlibet on Fri Nov 01, 2013 12:00 pm

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
quodlibet
 
Posts: 511
Joined: Sat Jun 18, 2011 5:53 pm

Re: ST3: FuzzyFileNav

Postby facelessuser on Fri Nov 01, 2013 7:42 pm

@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 ;).
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: FuzzyFileNav

Postby quodlibet on Fri Nov 01, 2013 8:17 pm

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?
quodlibet
 
Posts: 511
Joined: Sat Jun 18, 2011 5:53 pm

Re: ST3: FuzzyFileNav

Postby facelessuser on Fri Nov 01, 2013 8:28 pm

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 :). 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.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: FuzzyFileNav

Postby facelessuser on Mon Dec 23, 2013 1:49 am

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 ;).
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 19 guests