summaryrefslogtreecommitdiffstats
path: root/lib/libedit/vi.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-06-27 16:10:40 +0000
committerbrian <brian@FreeBSD.org>1998-06-27 16:10:40 +0000
commita2d16c69749e92b1c9f77a6574367a9a03fc34bb (patch)
tree69a15bba0358f5d889840c775bc6beb4fcd439de /lib/libedit/vi.c
parent3231ba4ceb6fd16d9e5a0bdca97a2a112de2734e (diff)
downloadFreeBSD-src-a2d16c69749e92b1c9f77a6574367a9a03fc34bb.zip
FreeBSD-src-a2d16c69749e92b1c9f77a6574367a9a03fc34bb.tar.gz
Fixes assorted problems with the history edit functions in libedit. This
affects sh, ftp (and others?). Submitted by: Max Euston <meuston@jmrodgers.com> PR: 6516
Diffstat (limited to 'lib/libedit/vi.c')
-rw-r--r--lib/libedit/vi.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/lib/libedit/vi.c b/lib/libedit/vi.c
index 3a8ef05..5099757 100644
--- a/lib/libedit/vi.c
+++ b/lib/libedit/vi.c
@@ -173,7 +173,7 @@ vi_prev_space_word(el, c)
el->el_line.cursor = cv_prev_word(el, el->el_line.cursor,
el->el_line.buffer,
el->el_state.argument,
- cv__isword);
+ c___isword);
if (el->el_chared.c_vcmd.action & DELETE) {
cv_delfini(el);
@@ -186,7 +186,7 @@ vi_prev_space_word(el, c)
/* vi_prev_word():
* Vi move to the previous word
- * [B]
+ * [b]
*/
protected el_action_t
/*ARGSUSED*/
@@ -200,7 +200,7 @@ vi_prev_word(el, c)
el->el_line.cursor = cv_prev_word(el, el->el_line.cursor,
el->el_line.buffer,
el->el_state.argument,
- ce__isword);
+ cv__isword);
if (el->el_chared.c_vcmd.action & DELETE) {
cv_delfini(el);
@@ -227,7 +227,7 @@ vi_next_space_word(el, c)
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
el->el_line.lastchar,
el->el_state.argument,
- cv__isword);
+ c___isword);
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action & DELETE) {
@@ -254,7 +254,7 @@ vi_next_word(el, c)
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
el->el_line.lastchar,
el->el_state.argument,
- ce__isword);
+ cv__isword);
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action & DELETE) {
@@ -346,7 +346,7 @@ vi_replace_char(el, c)
el->el_chared.c_undo.ptr = el->el_line.cursor;
el->el_chared.c_undo.isize = 0;
el->el_chared.c_undo.dsize = 0;
- return CC_NORM;
+ return CC_ARGHACK;
}
@@ -366,13 +366,13 @@ vi_replace_mode(el, c)
el->el_chared.c_undo.ptr = el->el_line.cursor;
el->el_chared.c_undo.isize = 0;
el->el_chared.c_undo.dsize = 0;
- return CC_NORM;
+ return CC_ARGHACK;
}
/* vi_substitute_char():
* Vi replace character under the cursor and enter insert mode
- * [r]
+ * [s]
*/
protected el_action_t
/*ARGSUSED*/
@@ -448,7 +448,8 @@ vi_add(el, c)
EditLine *el;
int c;
{
- int ret;
+ el_action_t ret;
+
el->el_map.current = el->el_map.key;
if (el->el_line.cursor < el->el_line.lastchar) {
el->el_line.cursor++;
@@ -664,6 +665,21 @@ vi_undo(el, c)
}
+/* vi_undo_line():
+ * Vi undo all changes
+ * [U]
+ */
+protected el_action_t
+/*ARGSUSED*/
+vi_undo_line(el, c)
+ EditLine *el;
+ int c;
+{
+
+ return hist_get(el);
+}
+
+
/* vi_command_mode():
* Vi enter command mode (use alternative key bindings)
* [<ESC>]
OpenPOWER on IntegriCloud