nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] options: let --afterends affect also the deleting of words (Ctrl


From: Benno Schulenberg
Subject: [PATCH] options: let --afterends affect also the deleting of words (Ctrl+Delete)
Date: Sun, 12 Apr 2020 11:27:25 +0200

It makes more sense that <Ctrl+Delete> deletes the same thing as
what would be selected with <Shift+Ctrl+Right>.

Suggested-by: Liu Hao <address@hidden>
---
 doc/nano.1           | 2 +-
 doc/nano.texi        | 4 ++--
 doc/nanorc.5         | 2 +-
 doc/sample.nanorc.in | 4 ++--
 src/cut.c            | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/nano.1 b/doc/nano.1
index 68fbedb4..c5668c89 100644
--- 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
index debeb939..32420d79 100644
--- 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
@@ -715,7 +715,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
index 70ed0d97..f86c295b 100644
--- 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
index 8ee33a40..8d0405e1 100644
--- 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
index 806b0d34..50cd9967 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -191,7 +191,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;
-- 
2.25.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]