Home Download Buy Blog Forum Support

Mousemap & File-Specific commands

Mousemap & File-Specific commands

Postby spadgos on Thu Oct 06, 2011 5:50 am

I've seen that there's no scope selector option for mousemap commands, however is it possible to add commands just for a particular file type?

Essentially what I'm trying to do is something similar to how the output from Find In Files is able to open a file by double-clicking on the output. Obviously, I don't want to change the double-click behaviour for all files.

Or, am I going about this the wrong way? The only place where I need these special commands would be in a scratch view which I'm already setting up in a different command. Is it possible to add event listeners there to achieve what I'm after?
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: Mousemap & File-Specific commands

Postby jps on Thu Oct 06, 2011 2:03 pm

The way to do it would be to add a context onto your binding, so it's only active some times (e.g., when a particular setting is enabled).

Unfortunately, mousemap bindings don't support contexts at the moment though.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Mousemap & File-Specific commands

Postby spadgos on Thu Oct 06, 2011 2:55 pm

So there's no way to emulate the Find results page then?
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: Mousemap & File-Specific commands

Postby bizoo on Thu Mar 01, 2012 10:38 am

Any news about the context support in mousemap ?
This is required if you want to achieve same behavior as Find results page.
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Mousemap & File-Specific commands

Postby wuub on Fri May 11, 2012 10:00 am

jps wrote:Unfortunately, mousemap bindings don't support contexts at the moment though.


Are you planning to add contexts support to mousmap bindings or is it something that will never be possible?
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: Mousemap & File-Specific commands

Postby C0D312 on Fri May 11, 2012 5:57 pm

wuub wrote:
jps wrote:Unfortunately, mousemap bindings don't support contexts at the moment though.


Are you planning to add contexts support to mousmap bindings or is it something that will never be possible?


As a workaround, you could use on_selection_modified and try your best to determine what a mouse click is. For example, if abs(previous_selection - current_selection) > 1: ...
Obviously not your best bet... but w/e.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests