Summary: | Undo cursor move | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Marcos Dione <mdione> |
Component: | part | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | mickael.bosch, waqar.17a |
Priority: | NOR | ||
Version: | 18.12.3 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Marcos Dione
2019-07-18 09:57:26 UTC
I would like to implement this in Kate. How : - connect a slot to KTextEditor::View::cursorPositionChanged() - fill a map<KTextEditor::View, list<KTextEditor::Cursor>> in this slot - register the actions "undo move cursor" and "redo move cursor in the View menu with their associated shortcuts and the hardcoded shortcuts ctrl + "mouse previous/next button" - when the action is triggered, apply it on the current view and update the map[view] list accordingly. In a second commit: - allow to discard jumps when the relative cursor move is less than N lines - allow to limit the lists sizes (I doubt this will save a lot of memory but the original post only suggests to undo few bad keystrokes). On my own wishlist: - allow to configure the mouse buttons actions but I did not see any easy option in the KDE framework. The Kate tab bar already use the "mouse previous/next button" but I don't use the tab bar, thus the "mouse previous/next button" are a good mouse shortcut for me. Any suggestions before I try this? Hm, there already is a way in the code to jump to saved editing positions: https://github.com/KDE/ktexteditor/blob/master/src/document/katedocument.h#L406 I believe instead of adding yet another way of doing this, maybe this already works or can be reused? Kate since 21.04 maintains a history of last locations that you can jump to. Look for buttons to the left of tab bar. |