diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-21 20:54:27 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-21 20:54:27 -0700 |
commit | 515b0cdcc0b4c61c2636444b08d3868e902d380d (patch) | |
tree | 55b55bbce5cc83a846ab565a402e34918eff3b5f /debug.h | |
parent | 0b0cfc846c30bb56d0f46949ecd1223028f65bb1 (diff) | |
download | txr-515b0cdcc0b4c61c2636444b08d3868e902d380d.tar.gz txr-515b0cdcc0b4c61c2636444b08d3868e902d380d.tar.bz2 txr-515b0cdcc0b4c61c2636444b08d3868e902d380d.zip |
linenoise: squelch some useless undo items.
Sometimes edits don't do anything, and so the undo item
recorded for them is superfluous. When undo is used
nothing appears to happen for a turn.
We use two strategies: detect the noop change
and avoid recording the undo (or doing anything),
or else detecting the noop undo afterward and
removing it from the undo stack.
* linenoise/linenoise.c (remove_noop_undo): New static
function.
(edit_delete, edit_backspace): Remove noop undo.
(edit_delete_prev_word): Don't record undo, move
memory or update vars if there is no word to delete.
(edit_in_editor): Remove noop undo.
(edit): For Ctrl-T, don't record undo or do anything
other than clear the selection if the cursor
is leftmost already.
Diffstat (limited to 'debug.h')
0 files changed, 0 insertions, 0 deletions