diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-20 22:17:36 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-20 22:17:36 -0700 |
commit | bf953d07cf4caa822677b64cae5e8fc444bcdfe2 (patch) | |
tree | ed25f4930894e157d1f46f6fcf03823f847f740e /regex.c | |
parent | 7c3fd4898b04c0e7be5e67f781dd123bc1f61237 (diff) | |
download | txr-bf953d07cf4caa822677b64cae5e8fc444bcdfe2.tar.gz txr-bf953d07cf4caa822677b64cae5e8fc444bcdfe2.tar.bz2 txr-bf953d07cf4caa822677b64cae5e8fc444bcdfe2.zip |
linenoise: renumber history indices in undo items
This has to be done because each time a history line is added,
or taken back, the relative numbers change.
* linenoise/linenoise.c (undo_pop): New static function.
(restore_undo): Skip undo items which refer to lines of
history which no longer exist. Restore history[0] also.
(renumber_undo_hist): New static function.
(edit): When leaving, and removing the extra history
line representing the current line, renumber the undo
items by -1.
(lino_hist_add): After adding a line, bump the undo item
history indices by 1.
Diffstat (limited to 'regex.c')
0 files changed, 0 insertions, 0 deletions