summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-03-16 11:30:11 -0300
committerAndrés <andmarti@gmail.com>2021-03-16 11:30:11 -0300
commitc90fbf80ee6c834fd51f1c8423ac3a40d9fbb315 (patch)
treec56d9d134a64ffbac9c47371df36e4acce59574a
parentdd4eb5eb27edeec2ec49e1276c39ce9bd13992bf (diff)
EDIT MODE: fixed 'R' 'f' and added 'df' and 'cf'.
-rw-r--r--src/cmds_edit.c14
1 files 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;