summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-20 16:25:10 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-20 16:25:10 -0700
commit18f016a0e577982d9d78ec7133b3b53ff218da93 (patch)
treeef980aca6a684caccfa0f79202be6d686e4cd678 /txr.1
parent3df312a334ad3b2dbd146e5fb8b2bd2f9e086165 (diff)
downloadtxr-18f016a0e577982d9d78ec7133b3b53ff218da93.tar.gz
txr-18f016a0e577982d9d78ec7133b3b53ff218da93.tar.bz2
txr-18f016a0e577982d9d78ec7133b3b53ff218da93.zip
linenoise: undo feature.
* linenoise/linenoise.c (LINENOISE_MAX_UNDO): New preprocessor symbol. (struct lino_state): New member, undo_stack. (struct lino_undo): New struct type. (free_undo, record_undo, record_triv_undo, restore_undo): New static functions. (edit_insert): Record trivial undo item with record_triv_undo. (edit_insert_str, edit_history_next, edit_delete, edit_backspace, edit_delete_prev_all, edit_delete_prev_word, edit_in_editor): Record undo item. (edit): Record undo item before Ctrl-R history recall and Ctrl-T twiddle. Also record one final undo item upon Enter, as well as Ctrl-C. New Ctrl-O command to undo. (lino_copy): Do not copy undo_stack, to prevent double freeing. (lino_free): Free the undo history. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.126
1 files changed, 26 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 8a0e59d1..3a342db6 100644
--- a/txr.1
+++ b/txr.1
@@ -33821,6 +33821,32 @@ when written out to the file. Conversely, when the edited file is read
back, its newlines are converted to carriage returns, so that multi-line
content is handled properly. (See the following section, Multi-Line Mode).
+.NP* Undo
+
+The listener provides an undo feature. The Ctrl-O editing command will
+restore the edit buffer contents and cursor position to the state in which
+it was before a previous edit, or previous history navigation.
+
+Undo history is retained between lines. That is, after a line is submitted
+with Enter, it is still possible to undo previous edits. Moreover, if a line
+is canceled with Ctrl-C, such that it is not recorded in the recall history, it
+is still available from the undo history.
+
+Undo is limited to 32 states. Furthermore, the undo history is lost
+when \*(TX terminates.
+
+Undo doesn't restore previous contents of the clipboard buffer.
+
+Undo will restore edits made to history lines. It does so unconditionally,
+which means that it can introduce edits in the following situation.
+When a history line is edited and then sumbitted without navigating to
+a different history line, the edit isn't permanent. However, when the
+edits are retraced via undo, the restored states
+.I are
+stored in the history.
+
+There is no redo; undoing is permanent.
+
.SS* Visual Selection Mode
The interactive listener supports visual copy and paste operation.