diff options
author | Andrés <andmarti@gmail.com> | 2021-03-17 09:35:48 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-03-17 09:35:48 -0300 |
commit | c1407bb096ea499d19d11a587024409f2dd640b3 (patch) | |
tree | 56b5fcc88246d3af8a9818511b77c063bb2d2d3f | |
parent | 4fc2270e774de8f06dd1e479404d20c66d85ce7a (diff) |
EDIT_MODE: Added 'd^' 'dg_' 'c^' 'cg_' commands
-rw-r--r-- | src/cmds_edit.c | 17 | ||||
-rwxr-xr-x | src/doc | 9 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/cmds_edit.c b/src/cmds_edit.c index 094ddf0..5318008 100644 --- a/src/cmds_edit.c +++ b/src/cmds_edit.c @@ -388,6 +388,23 @@ void do_editmode(struct block * sb) { inputline_pos = wcswidth(inputline, real_inputline_pos); break; + case L'^': + pos = first_nonblank_char(); + if (pos == -1) return; + del_range_wchars(inputline, pos, real_inputline_pos-1); + real_inputline_pos = pos; + inputline_pos = wcswidth(inputline, real_inputline_pos); + break; + + case L'g': + if (ui_getch_b(&wi) == -1 || wi != L'_') return; + pos = last_nonblank_char(); + if (pos == -1) return; + del_range_wchars(inputline, real_inputline_pos, pos); + real_inputline_pos = pos; + inputline_pos = wcswidth(inputline, real_inputline_pos); + break; + case L'e': // de or ce del_range_wchars(inputline, real_inputline_pos, for_word(1, 0, 0)); break; @@ -279,14 +279,19 @@ Commands for handling cell content: de Delete until the end of the word. dw Delete until the beginning of the next word. + d0 Delete until the beginning of the line. + d$ Delete until the end of the line. + d^ Delete from position until the first non blank character of the line + dg_ Delete from position until the last non blank character of the line + db If at the beginning of a word, delete until the beginning of the previous word. Otherwise, delete until the beginning of the word under the cursor. daw Delete the word under the cursor. dE Delete until the end of WORD. dW Delete until the beginning of the next WORD. - d$ Delete until the end of the line. + dB If at the beginning of a word, delete until the beginning of previous WORD. Otherwise, delete until the beginning of the WORD under the cursor. @@ -309,6 +314,8 @@ Commands for handling cell content: cE Same as "dE", then enter Insert mode. cW Same as "dW", then enter Insert mode. c$ Same as "d$", then enter Insert mode. + c^ Same as "d^", then enter Insert mode. + cg_ Same as "dg_", then enter Insert mode. cB Same as "dB", then enter Insert mode. caW Same as "daW", then enter Insert mode. cl Same as "dl", then enter Insert mode. |