Sublime Forum

ST3: FuzzyFileNav

#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

#56

@jsc I don’t see this problem. Can you give me more info on your setup? And are you using the latest version?

0 Likes

#57

I’m using the version set up through Package Control for Sublime Text 3, Stable Channel, Build 3021. The package file is timestamped Feb 26, and the contents are identical to the version I pulled from github directly. The only packages I’m running are FFN, Package Control, and sublemacspro. I tried removing sublemacspro, and the behavior is the same. Maybe it’s the new build of Sublime?

If I click another tab, then click back to the newly opened file, the cursor appears and I can type in it, as if I had clicked on the first character.

0 Likes

#58

The issue can only be replicated when the panel is not set to stay open after file open. I now delay the window focus a bit; it should be fixed. Please let me know if it is working for you now.

0 Likes

#59

Okay, weird. Just reinstalled FFN from Package Control, and now it works as it always did.

0 Likes

#60

Well, I did push a fix.

0 Likes

#61

No focus on file open behavior is happening again. This is after upgrade to the latest Sublime version 3033.

0 Likes

#62

I am not sure how to fix this as of right now. I will look a little harder when I get some time, but Jon has really made this hard to get working proper on this latest release. I have no idea what he is doing in regards to this, but I cannot seem to get the view to focus on the quick panel selection event. It just won’t do it. I may have some other ideas, but I am going to wait until I have time.

0 Likes

#63

Are you guys talking about when you open a View (window.open_file etc) then set some callback to alter selections when the file is loaded, the focus wandering off somewhere?

0 Likes

#64

Yeah, the new open window just doesn’t have focus when the quick panel closes. Directly calling focus from the selection event doesn’t work, doing a set_timeout to call it recently doesn’t work. It is really just annoying more than anything. I haven’t really dug into finding a solution yet.

0 Likes

#65

Gah, yeah I’m getting that in a plugin too.

Da fuq??

0 Likes

#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