[Github-comments] [geany/geany] Go to previous cursor position (#1359)

Forkest notifications at xxxxx
Wed Jan 11 18:10:46 UTC 2017


Or it may be implemented without a timer: simply save each caret movement, but if the latest element in the caret history stack was added, say, less than a second ago, overwrite it (except for some cases, listed below). You don't need to keep the time for each position in the stack, the latest addition time variable is enough. In fact it shouldn't be real time, but monotonic time.

Perhaps there should be some additional checks, for example make sure to save (not to reset or overwrite):
- when the previous caret movement was caused by an edit and this one is caused by user movement, so an edit is never missing in history.
- before any special/external caret movement: before going to marker, before code navigation, before Ctrl+Home/End. Is there an easy way to hook somewhere in the API in a general way?

Actually, I see that there is already Code Navigation History, it should save the location before code navigation, maybe it can be merged with the new system, or even the new system can be built atop of it.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1359#issuecomment-271946959
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170111/3b4571b0/attachment.html>


More information about the Github-comments mailing list