Ticket #307 (new enhancement)
Ctrl-Left mouse jumps to definition
| Reported by: | szabgab | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Source Navigation | Version: | 0.34 |
| Keywords: | Cc: |
Description
I saw this in Eclipse + Perl plugin
If you click on ctrl and the left mouse button over a name of a function it jumps to the definition of the function.
Maybe it would also work with variable names, I am not sure.
Also I am not sure but if I think when the (left) ctrl button was pressed the clickable things were highlighted with and underline thing.
This might be a nice set of enhancements.
Change History
comment:2 Changed 4 years ago by tsee
"If you click on ctrl and the left mouse button over a name of a function it jumps to the definition of the function."
We now have that, too.
That leaves the following as a ToDo?:
"Also I am not sure but if I think when the (left) ctrl button was pressed the clickable things were highlighted with and underline thing."
comment:3 Changed 4 years ago by jquelin
really nice.
nitpicking:
- it selects stuff while jumping to the definition
- it doesn't work cross-files
comment:4 Changed 3 years ago by Mutant
I had a go at figuring out how to prevent the selection while jumping problem... but got no where... it seems scintilla may have something it runs after the on left up event to select text. Because your mouse pos isn't where the text is scrolled into view (and where the caret is presumably), the text gets selected... couldn't find any way around this, but maybe I didn't know where to look :)
comment:5 Changed 3 years ago by Mutant
Underlining on ctrl+mouse over now implemented - r11473 .. altho it relies on the outline being generated, which I don't think happens if the outline tree isn't open... maybe this should change tho?
Also it only works for subs/methods in the same file.
I'll add highlight + click-thru on module names when I get a chance.
comment:7 Changed 2 years ago by mj41
Feature introduced in r11473 was removed by somebody. This patch fix it
Index: lib/Padre/Wx/Outline.pm
===================================================================
--- lib/Padre/Wx/Outline.pm (revision 14158)
+++ lib/Padre/Wx/Outline.pm (working copy)
@@ -102,7 +102,10 @@
TRACE( $_[1] ) if DEBUG;
my $self = shift;
my $task = shift;
+
my $data = Params::Util::_ARRAY( $task->{data} ) or return;
+ Padre::Current->document->set_outline_data($data);
+
my $lock = $self->main->lock('UPDATE');
# Add the hidden unused root

"Maybe it would also work with variable names, I am not sure."
I just implemented that part for Padre.