1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-25 21:16:38 +03:00
kakoune/doc
Johannes Altmanninger c2ab5d4694 Allow to undo and redo selection changes
From the issue:

> It often happens to me that I carefully craft a selection with multiple
> cursors, ready to make changes elegantly, only to completely mess it
> up by pressing a wrong key (by merging the cursors for example). Being
> able to undo the last selection change (even if only until the previous
> buffer change) would make this much less painful.

Fix this by recording selection changes and allowing simple linear
undo/redo of selection changes.

The preliminary key bindings are <c-h> and <c-k>.
Here are some other vacant normal mode keys I considered

	X Y
	<backspace> <minus>
	# ^ =
	<plus> '

unfortunately none of them is super convenient to type.  Maybe we
can kick out some other normal mode command?

---

This feature has some overlap with the jump list (<c-o>/<c-i>) and
with undo (u) but each of the three features have their moment.

Currently there's no special integration with either peer feature;
the three histories are completely independent.  In future we might
want to synchronize them so we can implement Sublime Text's "Soft
undo" feature.

Note that it is possible to restore selections that predate a buffer
modification. Depending on the buffer modification, the selections
might look different of course. (When trying to apply an old buffer's
selection to the new buffer, Kakoune computes a diff of the buffers
and updates the selection accordingly. This works quite well for
many practical examples.)

This makes us record the full history of all selections for each
client. This seems wasteful, we could set a limit. I don't expect
excessive memory usage in practice (we also keep the full history of
buffer changes) but I could be wrong.

Closes #898
2022-09-02 02:59:47 +02:00
..
pages Allow to undo and redo selection changes 2022-09-02 02:59:47 +02:00
autoedit.asciidoc doc: fix typos and clarify some parts 2020-05-28 18:37:26 +02:00
coding-style.asciidoc Rename NCursesUI to TerminalUI 2021-07-12 10:25:58 +10:00
design.asciidoc Edit high-level design doc for ease of reading 2021-03-17 22:12:17 -04:00
interfacing.asciidoc Change completions option docstring element to be an arbitrary command 2019-04-17 08:38:52 +02:00
json_ui.asciidoc Refactor mouse press/release handling to support 3 buttons 2020-06-28 19:48:55 +10:00
kak.1 Describe 'filter mode' in more detail. 2021-12-13 09:05:22 +11:00
kakoune_logo.svg Add logo proposal. 2015-03-22 14:09:32 +01:00
screenshot-i3.gif Add some screenshots to README 2015-05-07 00:34:50 +01:00
screenshot-tmux.gif Add some screenshots to README 2015-05-07 00:34:50 +01:00
writing_scripts.asciidoc doc writing_scripts: Document echo portability issues 2020-05-04 12:10:23 +00:00