Bug 564931 - feature request: retain more than one last edit location
Summary: feature request: retain more than one last edit location
Status: CLOSED DUPLICATE of bug 72773
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.15   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2020-07-04 18:31 EDT by Ari Kast CLA
Modified: 2020-07-06 09:01 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ari Kast CLA 2020-07-04 18:31:14 EDT
I'd like the "last edit location" feature to behave more like a stack of last edit locations, retaining multiple locations as a history that can be traversed back or forward at will, similar to how a standard browser history functions.

I have a patch ready for this, so am using this ticket to document how it works and take feedback/concerns on how it could be better.

The way it works:

- ctrl q always takes you to most recent edit, identical to existing functionality, so anyone unaware of this new feature is unaffected and still sees identical behavior to existing

- continuing to hold ctrl and hitting q again activates the new feature, which iterates thru prior edit locations with each additional tap of the q key.  

- once history has been traversed, the newly traversed historical edit location now becomes the "base" going forward, meaning the next time ctrl q is pressed from scratch, this revised historical location is where you are now taken to

- the historical locations operates as a ring: continuing past the first history location simply cycles around to the end of the ring again, so holding ctrl and hitting q key N times always brings you full circle back to your starting location for an N-sized history ring.

- the size of the history ring is configured as an int constant, currently set to 10, but can easily be tweaked

- functionality also exists to move forward in the history ring, but this has not yet been mapped to any key combination.  I propose mapping this to shift-ctrl-q (I could use help on setting up that mapping, not sure where mappings live).  Once the forward mapping is added, then I would propose making the history larger, say 20 perhaps, as the consequences of overshooting are less.

- to minimize frivolously similar edit locations, an "edit history proximity" function is introduced so that when a new edit location is added to history, if another location already exists within a certain (configurable) proximity to the new location, then the old location is deleted prior to adding the new one.  This ensures that edit location history is populated with meaningfully distinct locations rather than a cluster of very similar locations.  Proximity threshold is currently set to 80 characters, but this can be tweaked.


I'd love to get feedback on the general approach taken in this patch, perhaps someone who knows overall architecture better might know a better/more idiomatic way to do it or might know additional cases to consider -- I'm happy to revise as needed.
Comment 1 Lars Vogel CLA 2020-07-06 02:18:02 EDT
+1, please provide Gerrit.

Looking forward to this feature.
Comment 2 Lars Vogel CLA 2020-07-06 02:35:20 EDT
We already have this feature request so I mark this as dup. Please contribute your patch to Bug 72773.

*** This bug has been marked as a duplicate of bug 72773 ***
Comment 3 Ari Kast CLA 2020-07-06 09:01:02 EDT
Will do.

I discovered two deficiencies in my patch, so will contribute once they are fixed.  It may take a little while as they'll both require some research to figure out how to fix (storing history across different tabs, and recalculating positions when edits occur above them).