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>
master
Benno Schulenberg 2020-04-12 11:15:28 +02:00
parent bcaa1ef7f2
commit 5755ecdbfc
5 changed files with 7 additions and 7 deletions

View File

@ -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. Don't show the two help lines at the bottom of the screen.
.TP .TP
.BR \-y ", " \-\-afterends .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 .TP
.BR \-z ", " \-\-suspendable .BR \-z ", " \-\-suspendable
Allow the user to suspend the editor (with \fB^Z\fR by default). Allow the user to suspend the editor (with \fB^Z\fR by default).

View File

@ -448,7 +448,7 @@ disabled to display the help-system navigation keys.
@item -y @item -y
@itemx --afterends @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 @item -z
@itemx --suspendable @itemx --suspendable
@ -727,7 +727,7 @@ The supported settings in a nanorc file are:
@table @code @table @code
@item set afterends @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 @item set allow_insecure_backup
When backing up files, allow the backup to succeed even if its When backing up files, allow the backup to succeed even if its

View File

@ -68,7 +68,7 @@ The supported commands and arguments are:
.TP 3 .TP 3
.B set afterends .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 .TP
.B set allow_insecure_backup .B set allow_insecure_backup
When backing up files, allow the backup to succeed even if its permissions When backing up files, allow the backup to succeed even if its permissions

View File

@ -8,8 +8,8 @@
## Inside string parameters, quotes should not be escaped -- the last ## Inside string parameters, quotes should not be escaped -- the last
## double quote on the line will be seen as the closing quote. ## double quote on the line will be seen as the closing quote.
## Make the 'nextword' function (Ctrl+Right) stop at word ends ## Make 'nextword' (Ctrl+Right) and 'chopwordright' (Ctrl+Delete)
## instead of at beginnings. ## stop at word ends instead of at beginnings.
# set afterends # set afterends
## When soft line wrapping is enabled, make it wrap lines at blanks ## When soft line wrapping is enabled, make it wrap lines at blanks

View File

@ -193,7 +193,7 @@ void chop_word(bool forward)
openfile->current_x = strlen(openfile->current->data); openfile->current_x = strlen(openfile->current->data);
} }
} else { } else {
do_next_word(FALSE, ISSET(WORD_BOUNDS)); do_next_word(ISSET(AFTER_ENDS), ISSET(WORD_BOUNDS));
if (openfile->current != is_current && if (openfile->current != is_current &&
is_current->data[is_current_x] != '\0') { is_current->data[is_current_x] != '\0') {
openfile->current = is_current; openfile->current = is_current;