summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-03-16 12:21:24 -0300
committerAndrés <andmarti@gmail.com>2021-03-16 12:21:24 -0300
commit4e58a7d2bc242ed58e4385ee8e33e9051d3c5c3d (patch)
tree2b55da5ba7100a4c1837fa704778683c9b38b2b1 /src
parentb4055630475b574fb45409771c3e84d2dd211dca (diff)
EDIT_MODE: added d0 d$ c0 c$ commands
Diffstat (limited to 'src')
-rw-r--r--src/cmds_edit.c12
-rwxr-xr-xsrc/doc4
2 files changed, 16 insertions, 0 deletions
diff --git a/src/cmds_edit.c b/src/cmds_edit.c
index c59876b..3a26aad 100644
--- a/src/cmds_edit.c
+++ b/src/cmds_edit.c
@@ -310,6 +310,12 @@ void do_editmode(struct block * sb) {
if (ui_getch_b(&wi) != -1) {
c = wi;
switch (c) {
+ case L'$':
+ pos = wcswidth(inputline, wcslen(inputline)) - 1;
+ del_range_wchars(inputline, real_inputline_pos, pos);
+ if (real_inputline_pos == wcslen(inputline) && real_inputline_pos) real_inputline_pos--;
+ inputline_pos = wcswidth(inputline, real_inputline_pos);
+ break;
case L'f':
if (ui_getch_b(&wi) == -1) return;
@@ -318,6 +324,12 @@ void do_editmode(struct block * sb) {
if (pos != -1) del_range_wchars(inputline, real_inputline_pos, pos);
break;
+ case L'0': // 0
+ del_range_wchars(inputline, 0, real_inputline_pos-1);
+ real_inputline_pos = 0;
+ 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;
diff --git a/src/doc b/src/doc
index 771bcf1..fceab33 100755
--- a/src/doc
+++ b/src/doc
@@ -275,12 +275,14 @@ 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.
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.
@@ -295,10 +297,12 @@ Commands for handling cell content:
ce Same as "de", then enter Insert mode.
cw Same as "dw", then enter Insert mode.
+ c0 Same as "d0", then enter Insert mode.
cb Same as "db", then enter Insert mode.
caw Same as "daw", then enter Insert mode.
cE Same as "dE", then enter Insert mode.
cW Same as "dW", then enter Insert mode.
+ c$ Same as "d$", 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.