From c90fbf80ee6c834fd51f1c8423ac3a40d9fbb315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Tue, 16 Mar 2021 11:30:11 -0300 Subject: EDIT MODE: fixed 'R' 'f' and added 'df' and 'cf'. --- src/cmds_edit.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/cmds_edit.c b/src/cmds_edit.c index 5257659..48e2cc9 100644 --- a/src/cmds_edit.c +++ b/src/cmds_edit.c @@ -230,7 +230,7 @@ void do_editmode(struct block * sb) { return; } else if (sb->value == L'f') { // f - if (ui_getch_b(&wi) != -1) return; + if (ui_getch_b(&wi) == -1) return; int pos = look_for((wchar_t) wi); // this returns real_inputline_pos ! if (pos != -1) { real_inputline_pos = pos; @@ -277,7 +277,7 @@ void do_editmode(struct block * sb) { } else if (sb->value == L'R') { // R //curs_set(1); - if (ui_getch_b(&wi) != -1) return; + if (ui_getch_b(&wi) == -1) return; wint_t c = wi; while (c != OKEY_ENTER && c != -1) { if (iswprint(c)) { @@ -286,7 +286,7 @@ void do_editmode(struct block * sb) { inputline_pos = wcswidth(inputline, real_inputline_pos); ui_show_header(); } - if (ui_getch_b(&wi) != -1) return; + if (ui_getch_b(&wi) == -1) return; c = wi; } //curs_set(2); @@ -297,6 +297,14 @@ void do_editmode(struct block * sb) { if (ui_getch_b(&wi) != -1) { c = wi; switch (c) { + + case L'f': + if (ui_getch_b(&wi) == -1) return; + d = wi; + int pos = look_for((wchar_t) d); // this returns real_inputline_pos ! + if (pos != -1) del_range_wchars(inputline, real_inputline_pos, pos); + break; + case L'e': // de or ce del_range_wchars(inputline, real_inputline_pos, for_word(1, 0, 0)); break; -- cgit v1.2.3