diff options
author | ache <ache@FreeBSD.org> | 2001-04-11 02:33:07 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-04-11 02:33:07 +0000 |
commit | e5103242d94d5211fa44bad651caaa7a61519867 (patch) | |
tree | 2a3a3b5b7ce03cb28810b3212cb44a3a1698ca44 /contrib/libreadline/undo.c | |
parent | b85a0e54aedf144ea0dff369289bd3fb6f694f5f (diff) | |
download | FreeBSD-src-e5103242d94d5211fa44bad651caaa7a61519867.zip FreeBSD-src-e5103242d94d5211fa44bad651caaa7a61519867.tar.gz |
v4.2 initial import
Diffstat (limited to 'contrib/libreadline/undo.c')
-rw-r--r-- | contrib/libreadline/undo.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/libreadline/undo.c b/contrib/libreadline/undo.c index f7f30d1..e29e940 100644 --- a/contrib/libreadline/undo.c +++ b/contrib/libreadline/undo.c @@ -86,7 +86,7 @@ rl_add_undo (what, start, end, text) /* Free the existing undo list. */ void -free_undo_list () +rl_free_undo_list () { while (rl_undo_list) { @@ -107,17 +107,18 @@ int rl_do_undo () { UNDO_LIST *release; - int waiting_for_begin = 0; - int start, end; + int waiting_for_begin, start, end; #define TRANS(i) ((i) == -1 ? rl_point : ((i) == -2 ? rl_end : (i))) + start = end = waiting_for_begin = 0; do { if (!rl_undo_list) return (0); _rl_doing_an_undo = 1; + RL_SETSTATE(RL_STATE_UNDOING); /* To better support vi-mode, a start or end value of -1 means rl_point, and a value of -2 means rl_end. */ @@ -152,11 +153,12 @@ rl_do_undo () if (waiting_for_begin) waiting_for_begin--; else - ding (); + rl_ding (); break; } _rl_doing_an_undo = 0; + RL_UNSETSTATE(RL_STATE_UNDOING); release = rl_undo_list; rl_undo_list = rl_undo_list->next; @@ -231,7 +233,7 @@ rl_revert_line (count, key) int count, key; { if (!rl_undo_list) - ding (); + rl_ding (); else { while (rl_undo_list) @@ -254,7 +256,7 @@ rl_undo_command (count, key) count--; else { - ding (); + rl_ding (); break; } } |