Bug 72773 - [navigation] Remember more than one last edit location (Ctrl+Q history)
Summary: [navigation] Remember more than one last edit location (Ctrl+Q history)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement with 9 votes (vote)
Target Milestone: 4.17 M3   Edit
Assignee: Ari Kast CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy, usability
: 192504 211105 275541 501454 564931 (view as bug list)
Depends on:
Blocks: 563540 565954
  Show dependency tree
 
Reported: 2004-08-27 06:54 EDT by stephan.freund CLA
Modified: 2021-07-24 11:19 EDT (History)
22 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stephan.freund CLA 2004-08-27 06:54:41 EDT
It would be great if Eclipse would remember more than one last edit location.
Than it would be possible to press Ctrl + Q more than one time.
Comment 1 Dani Megert CLA 2004-08-27 09:38:56 EDT
This is already on the 3.1 plan
Comment 2 Dani Megert CLA 2005-05-30 04:09:35 EDT
Deferred.
Comment 3 Dani Megert CLA 2007-06-14 03:38:00 EDT
*** Bug 192504 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2007-11-28 03:23:13 EST
*** Bug 211105 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2009-05-11 11:54:00 EDT
*** Bug 275541 has been marked as a duplicate of this bug. ***
Comment 6 Sam Davis CLA 2012-07-23 18:34:12 EDT
I was going to open a new bug for this, but I guess it's just a special case of multiple edit locations:

* open a new untitled text file
* type in the text file
* close it without saving
* press Ctrl+Q
* a new untiled text file is opened

The previous last edit location should be used instead.
Comment 7 Markus Keller CLA 2016-09-15 09:59:43 EDT
*** Bug 501454 has been marked as a duplicate of this bug. ***
Comment 8 Sergey Ilinykh CLA 2016-12-28 04:31:40 EST
Hi

I have similar request.
But not just *EDIT* locations but any locations you recently were at.
And the most important thing is shortcuts to navigate backward and forth.

I use this feature in Qt Creator and it's just tremendous handy!
In Qt Creator it's Alt+<left or right arrow>
Comment 9 Aaron Digulla CLA 2016-12-29 09:15:49 EST
(In reply to Sergey Ilinykh from comment #8)
> But not just *EDIT* locations but any locations you recently were at.
> And the most important thing is shortcuts to navigate backward and forth.
> 
> I use this feature in Qt Creator and it's just tremendous handy!
> In Qt Creator it's Alt+<left or right arrow>

Eclipse already supports this. Just try Alt+<left or right arrow>.
Comment 10 Sergey Ilinykh CLA 2016-12-29 10:08:52 EST
(In reply to Aaron Digulla from comment #9)
> Eclipse already supports this. Just try Alt+<left or right arrow>.

No, it's not *any* location. Probably just edit.

Often I just learn some code jumping everywhere and not changing anything. And I need a way to jump to previous looked location and then forth.

Example..
1. ctrl+click on some function call
2. "It seems that's exactly what I'm looking for! but I forgot function arguments"
3. alt+<left>
4. "Yeah! that's it. Now let's review how it works with these arguments"
5. alt+<right>
Comment 11 Dani Megert CLA 2018-05-24 12:52:29 EDT
Removing target milestone for all bugs that are not major or above.
Comment 12 Dani Megert CLA 2018-05-25 04:06:37 EDT
> Removing target milestone for all bugs that are not major or above.

Of course I meant "major or below".

Sorry for the noise!
Comment 13 Lars Vogel CLA 2020-07-06 02:35:20 EDT
*** Bug 564931 has been marked as a duplicate of this bug. ***
Comment 14 Ari Kast CLA 2020-07-06 09:07:55 EDT
Working on it.

Thought I had a patch ready but discovered some issues which will require time to resolve.  Unfortunately won't be able to work on it til next week; will post once resolved.
Comment 15 Lars Vogel CLA 2020-07-06 09:09:49 EDT
(In reply to Ari Kast from comment #14)
> Working on it.
> 
> Thought I had a patch ready but discovered some issues which will require
> time to resolve.  Unfortunately won't be able to work on it til next week;
> will post once resolved.

Thanks you. Really looking forward to this functionality. This is on my wish list since years, but I never found the time to investigate it.
Comment 16 Ari Kast CLA 2020-07-11 13:24:06 EDT
All issues are resolved, works well locally.  I'm just cleaning up code and would like to add a forward mapping (ctrl shift q) to complement the backward mapping (ctrl q).  

Can someone advise where key mappings are defined?
Comment 17 Eclipse Genie CLA 2020-07-20 09:44:06 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/166530
Comment 18 Ari Kast CLA 2020-07-24 09:49:45 EDT
Code complete, patch uploaded, and build passes, so AFAIK this is done from my end.  Please advise if anything further I should do on this.
Comment 20 Lars Vogel CLA 2020-08-07 02:43:30 EDT
Thanks Ari, this feature is tremendous useful. Can you add it to the N&N for 4.17? 

You find an example here: https://git.eclipse.org/r/c/platform/eclipse.platform.common/+/166739
Comment 21 Ari Kast CLA 2020-08-07 12:41:20 EDT
Sure Lars will do.  Currently that file contains lots of 4.16 N&N content -- should I clear it all out and start fresh for 4.17 before adding my content?
Comment 22 Eclipse Genie CLA 2020-08-10 01:07:08 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.common/+/167435
Comment 23 Ari Kast CLA 2020-08-10 01:11:57 EDT
^^ PR adding to N&N for 4.17
Comment 24 Eclipse Genie CLA 2020-08-10 09:37:45 EDT
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/167481
Comment 26 Lars Vogel CLA 2020-08-10 09:49:54 EDT
Thanks, Ari.

I hope to see more contributions from you in the future.
Comment 27 Julian Honnen CLA 2020-08-11 07:17:03 EDT
This change breaks the @ symbol on german keyboards (Ctrl+Alt+Q).

Please change that keybinding.
Comment 28 Ari Kast CLA 2020-08-11 10:40:55 EDT
Sure, any suggestions on a better key combo would be welcome.  I would have preferred ctrl+shift+q but the ctrl+shift in particular seems to be verboten (it doesn't work, I tried it).

So that leaves me with perhaps ctrl+1 (that's a numeral one) or maybe ctrl+w (not sure if that already maps to something).  Or maybe something fancy like ctrl+ctrl+q (double-tap ctrl before hitting Q) -- dunno if there's built-in support for that kind of thing.

Advice/opinions/guidance welcome.
Comment 29 Julian Honnen CLA 2020-08-11 10:49:25 EDT
(In reply to Ari Kast from comment #28)
> Sure, any suggestions on a better key combo would be welcome.  I would have
> preferred ctrl+shift+q but the ctrl+shift in particular seems to be verboten
> (it doesn't work, I tried it).
> 
> So that leaves me with perhaps ctrl+1 (that's a numeral one) or maybe ctrl+w
> (not sure if that already maps to something).  Or maybe something fancy like
> ctrl+ctrl+q (double-tap ctrl before hitting Q) -- dunno if there's built-in
> support for that kind of thing.
> 
> Advice/opinions/guidance welcome.
Ctrl+1 is used by quickfix, ctrl+w by close editor

Navigate Back/Forward is mapped to Alt+Left/Right, so maybe Ctrl+Alt+Left/Right would make sense here?


BTW: the mouse buttons 4 and 5 are also mapped to navigate back/forward, I tried to map them to the edit location history instead but that doesn't seem possible in the preferences.
Comment 30 Ari Kast CLA 2020-08-11 12:22:48 EDT
I think I figured out why Ctrl Shift Q doesn't work -- it's already used by another mapping.

Regarding switching to the left/right idiom, I'd be reluctant to abandon the longstanding Ctrl Q mapping that has been there for at least a decade.  Would be nice to let people continue using the shortcut they're used to.

So I suppose I could do Shift Ctrl Alt Q (Shift Ctrl Opt Q on Mac), I tried it and works ok, aside from scrunched fingers when doing it single-handedly :) (I did find a way to do it comfortably actually, just takes a little practice to remember the right fingering).
Comment 31 Lars Vogel CLA 2020-08-11 13:47:12 EDT
(In reply to Ari Kast from comment #30)
> I think I figured out why Ctrl Shift Q doesn't work -- it's already used by
> another mapping.
> 
> Regarding switching to the left/right idiom, I'd be reluctant to abandon the
> longstanding Ctrl Q mapping that has been there for at least a decade. 
> Would be nice to let people continue using the shortcut they're used to.
> 
> So I suppose I could do Shift Ctrl Alt Q (Shift Ctrl Opt Q on Mac), I tried
> it and works ok, aside from scrunched fingers when doing it single-handedly
> :) (I did find a way to do it comfortably actually, just takes a little
> practice to remember the right fingering).

That sounds to complex. +1 for Ctrl+Alt+Left/Right would make sense here?
Comment 32 Ari Kast CLA 2020-08-11 15:41:21 EDT
OK I can switch to use some kind of left/right type idiom.

On Macs the forward/backward navigation is actually mapped to Cmd ] and Cmd [

I guess because left/right arrow often have OS-level mappings for things like changing views and whatnot.  That's one reason I'm nervous to mess with the arrow keys.  What do you think of building on the [ ] idiom, eg ctrl [ or maybe alt [

BTW I could redundantly preserve the legacy Ctrl Q mapping as well, but I found that for some reason that mapping takes priority for display in the GUI menu, regardless of definition order in plugin.xml.  For that reason perhaps I won't include the redundant legacy mapping unless I can find a way to do it more silently.
Comment 33 Ari Kast CLA 2020-08-11 16:14:02 EDT
To be clear though, I did try the ctrl arrow mappings on my Mac and it worked fine without interfering with any system functionality that I'm aware of, so that route does appear viable.
Comment 34 Eclipse Genie CLA 2020-08-11 23:26:00 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/167567
Comment 36 Lars Vogel CLA 2020-08-12 11:05:23 EDT
Ari, please also check Bug 565954.
Comment 37 Eclipse Genie CLA 2020-08-12 11:24:18 EDT
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/167596