Sublime Forum

Mousemap & File-Specific commands

#1

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?

0 Likes

Can we please get context support for mousemap files?
Updates for the stable Sublime Text
#2

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.

0 Likes

#3

So there’s no way to emulate the Find results page then?

0 Likes

#4

Any news about the context support in mousemap ?
This is required if you want to achieve same behavior as Find results page.

0 Likes

#5

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

0 Likes

Nightly Build 2198
#6

[quote=“wuub”]

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

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.

0 Likes