projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ld/
[deliverable/binutils-gdb.git]
/
readline
/
undo.c
diff --git
a/readline/undo.c
b/readline/undo.c
index f7f30d17d9d8dc48d99e7c4e50069d04e647933d..fedfa121fc0d7e68c89da0e5a63ae4ec395c214e 100644
(file)
--- a/
readline/undo.c
+++ b/
readline/undo.c
@@
-48,8
+48,7
@@
#include "history.h"
#include "rlprivate.h"
#include "history.h"
#include "rlprivate.h"
-
-#define SWAP(s, e) do { int t; t = s; s = e; e = t; } while (0)
+#include "xmalloc.h"
/* Non-zero tells rl_delete_text and rl_insert_text to not add to
the undo list. */
/* Non-zero tells rl_delete_text and rl_insert_text to not add to
the undo list. */
@@
-86,7
+85,7
@@
rl_add_undo (what, start, end, text)
/* Free the existing undo list. */
void
/* Free the existing undo list. */
void
-free_undo_list ()
+
rl_
free_undo_list ()
{
while (rl_undo_list)
{
{
while (rl_undo_list)
{
@@
-107,17
+106,18
@@
int
rl_do_undo ()
{
UNDO_LIST *release;
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)))
#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;
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. */
/* 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
+152,12
@@
rl_do_undo ()
if (waiting_for_begin)
waiting_for_begin--;
else
if (waiting_for_begin)
waiting_for_begin--;
else
- ding ();
+
rl_
ding ();
break;
}
_rl_doing_an_undo = 0;
break;
}
_rl_doing_an_undo = 0;
+ RL_UNSETSTATE(RL_STATE_UNDOING);
release = rl_undo_list;
rl_undo_list = rl_undo_list->next;
release = rl_undo_list;
rl_undo_list = rl_undo_list->next;
@@
-231,12
+232,17
@@
rl_revert_line (count, key)
int count, key;
{
if (!rl_undo_list)
int count, key;
{
if (!rl_undo_list)
- ding ();
+
rl_
ding ();
else
{
while (rl_undo_list)
rl_do_undo ();
else
{
while (rl_undo_list)
rl_do_undo ();
+#if defined (VI_MODE)
+ if (rl_editing_mode == vi_mode)
+ rl_point = rl_mark = 0; /* rl_end should be set correctly */
+#endif
}
}
+
return 0;
}
return 0;
}
@@
-254,7
+260,7
@@
rl_undo_command (count, key)
count--;
else
{
count--;
else
{
- ding ();
+
rl_
ding ();
break;
}
}
break;
}
}
This page took
0.023584 seconds
and
4
git commands to generate.