Should be fixed now in 3008.
Build 3007
[quote=“xeno.by”]
+1
I’d second this suggestion. It’s possible to emulate this feature (at least, it worked in ST2), but the implementation is really cumbersome.[/quote]
-1
I’m retracting my +1 here. This functionality is exactly what “Goto Definition…” is. Didn’t even realize this. Works perfectly as-is with keyboard shortcuts. Thanks jps.
I’m retracting my +1 here. This functionality is exactly what “Goto Definition…” is. Didn’t even realize this. Works perfectly as-is with keyboard shortcuts. Thanks jps.
I’m well aware of F12.
But sometimes I navigate the project with the mouse (usually when I forget a filename and navigate the Folders view), and Alt+Click instead of F12 is thus niceness (ctrl+click is already taken for multiple cursors, but that’s fine)
But sometimes I navigate the project with the mouse (usually when I forget a filename and navigate the Folders view), and Alt+Click instead of F12 is thus niceness (ctrl+click is already taken for multiple cursors, but that’s fine)
alt+click should be already taken as well for removing multiple cursers (that is, dragging them). However, you should be able to create a mouse mapping that runs the goto definition command, e.g. when ctrl-alt-clicking or alt-doubleclicking. See existing “.sublime-mousemap” files for reference.
The problem is not in mousemap. It’s in getting the coordinates of the text that’s been clicked.
The problem is not in mousemap. It’s in getting the coordinates of the text that’s been clicked.
SublimeXiki has some example code to do something like this in ST2
[quote=“lunixbochs”]
The problem is not in mousemap. It’s in getting the coordinates of the text that’s been clicked.
SublimeXiki has some example code to do something like this in ST2[/quote]
view.sel()[0] isn’t going to work with multiple selections. By “not going work” I mean that I don’t know how to have a mouseclick command that leaves multiple selections untouched and is able to do custom logic based on the clicked location. Here’s what I have to do in sublime-ensime: github.com/sublimescala/sublime … me.py#L190, and still that’s not good enough. If you know a better way, please, tell me.
Two options.
-
Make the command only work with a single selection. I can’t imagine a case where you’d want to run “goto definition” with multiple cursors - by mouse.
-
In ST2 you could hook into the “run_” method which just removed the “event” argument from the arguments table. This “event” argument contained details on mouseclicks. Not sure if you can do this in ST3 too.
[quote=“FichteFoll”]Two options.
-
Make the command only work with a single selection. I can’t imagine a case where you’d want to run “goto definition” with multiple cursors - by mouse.
-
In ST2 you could hook into the “run_” method which just removed the “event” argument from the arguments table. This “event” argument contained details on mouseclicks. Not sure if you can do this in ST3 too.[/quote]
-
A valid argument, but why not do better if we can do better?
-
That’s exactly what I do in the code linked above. Unfortunately, I haven’t found a way to translate screen coords into text coords.
Also, it would be really nice if you supported variable substitution (e.g. ${filepath/…}) in the symbol transform expression.
+1
More specifically, could you also include the ability to insert previous elements from the parent scope? For instance, it would be useful if we could prepend the parent class’s name to a method, when transforming its symbol. It should be easy to do if supported, by prepending something like “${meta.class-struct-block.c++ entity.name.type.c++}::” to the method name.