From 2c7d3367115bafafbad2b07be416261fb50cc5e2 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 24 Feb 2019 17:04:17 +0100 Subject: [PATCH] bindings: rename 'cutwordleft' to 'chopwordleft', and similar for right These bindable functions should not connote cutting, as they don't put anything into the cutbuffer. --- doc/nano.texi | 4 ++-- doc/nanorc.5 | 4 ++-- doc/sample.nanorc.in | 2 +- src/global.c | 6 ++++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/nano.texi b/doc/nano.texi index 74ab9dee..04f28ce9 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -1183,13 +1183,13 @@ current cursor position. Throws away the current line (or the marked region). (This function is bound by default to .) -@item cutwordleft +@item chopwordleft Deletes from the cursor position to the beginning of the preceding word. (This function is bound by default to . If your terminal produces @code{^H} for , you can make delete the word to the left of the cursor by rebinding ^H to this function.) -@item cutwordright +@item chopwordright Deletes from the cursor position to the beginning of the next word. (This function is bound by default to .) diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 091b9e9e..6fa8b14f 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -524,13 +524,13 @@ current cursor position. Throws away the current line (or the marked region). (This function is bound by default to .) .TP -.B cutwordleft +.B chopwordleft Deletes from the cursor position to the beginning of the preceding word. (This function is bound by default to . If your terminal produces \fB^H\fR for , you can make delete the word to the left of the cursor by rebinding ^H to this function.) .TP -.B cutwordright +.B chopwordright Deletes from the cursor position to the beginning of the next word. (This function is bound by default to .) .TP diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in index 83aa6e78..e70fb7f1 100644 --- a/doc/sample.nanorc.in +++ b/doc/sample.nanorc.in @@ -270,7 +270,7 @@ ## keycode, which is hard-bound to the backspace function. So, if you ## normally use for backspacing and not ^H, you can make ## delete the word to the left of the cursor with: -# bind ^H cutwordleft main +# bind ^H chopwordleft main ## If you would like nano to have keybindings that are more "usual", ## such as ^O for Open, ^F for Find, ^H for Help, and ^Q for Quit, diff --git a/src/global.c b/src/global.c index cc1dd08b..2932f959 100644 --- a/src/global.c +++ b/src/global.c @@ -1519,9 +1519,11 @@ sc *strtosc(const char *input) s->func = do_indent; else if (!strcasecmp(input, "unindent")) s->func = do_unindent; - else if (!strcasecmp(input, "cutwordleft")) + else if (!strcasecmp(input, "chopwordleft") || + !strcasecmp(input, "cutwordleft")) /* Deprecated; remove in 2020. */ s->func = do_cut_prev_word; - else if (!strcasecmp(input, "cutwordright")) + else if (!strcasecmp(input, "chopwordright") || + !strcasecmp(input, "cutwordright")) /* Deprecated; remove in 2020. */ s->func = do_cut_next_word; else if (!strcasecmp(input, "findbracket")) s->func = do_find_bracket;