commit 5755ecdbfce3f66927924a2f0468a28e0eb7f5bf
parent bcaa1ef7f27060bdc4fbd9986464f312e89647ef
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 12 Apr 2020 11:15:28 +0200
options: let --afterends affect also the deleting of words (Ctrl+Delete)
It makes more sense that <Ctrl+Delete> deletes the same thing as what
<Shift+Ctrl+Right> would select.
Suggested-by: Liu Hao <lh_mouse@126.com>
Diffstat:
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/doc/nano.1 b/doc/nano.1
@@ -314,7 +314,7 @@ This is the default. (This option is the opposite of \fB\-b\fR
Don't show the two help lines at the bottom of the screen.
.TP
.BR \-y ", " \-\-afterends
-Make Ctrl+Right stop at word ends instead of beginnings.
+Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
.TP
.BR \-z ", " \-\-suspendable
Allow the user to suspend the editor (with \fB^Z\fR by default).
diff --git a/doc/nano.texi b/doc/nano.texi
@@ -448,7 +448,7 @@ disabled to display the help-system navigation keys.
@item -y
@itemx --afterends
-Make Ctrl+Right stop at word ends instead of beginnings.
+Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
@item -z
@itemx --suspendable
@@ -727,7 +727,7 @@ The supported settings in a nanorc file are:
@table @code
@item set afterends
-Make Ctrl+Right stop at word ends instead of beginnings.
+Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
@item set allow_insecure_backup
When backing up files, allow the backup to succeed even if its
diff --git a/doc/nanorc.5 b/doc/nanorc.5
@@ -68,7 +68,7 @@ The supported commands and arguments are:
.TP 3
.B set afterends
-Make Ctrl+Right stop at word ends instead of beginnings.
+Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
.TP
.B set allow_insecure_backup
When backing up files, allow the backup to succeed even if its permissions
diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in
@@ -8,8 +8,8 @@
## Inside string parameters, quotes should not be escaped -- the last
## double quote on the line will be seen as the closing quote.
-## Make the 'nextword' function (Ctrl+Right) stop at word ends
-## instead of at beginnings.
+## Make 'nextword' (Ctrl+Right) and 'chopwordright' (Ctrl+Delete)
+## stop at word ends instead of at beginnings.
# set afterends
## When soft line wrapping is enabled, make it wrap lines at blanks
diff --git a/src/cut.c b/src/cut.c
@@ -193,7 +193,7 @@ void chop_word(bool forward)
openfile->current_x = strlen(openfile->current->data);
}
} else {
- do_next_word(FALSE, ISSET(WORD_BOUNDS));
+ do_next_word(ISSET(AFTER_ENDS), ISSET(WORD_BOUNDS));
if (openfile->current != is_current &&
is_current->data[is_current_x] != '\0') {
openfile->current = is_current;