diff --git a/doc/nano.1 b/doc/nano.1 index 155dbb4f..44f55406 100644 --- a/doc/nano.1 +++ b/doc/nano.1 @@ -188,7 +188,7 @@ Show a summary of the available command-line options and exit. Indent new lines to the previous line's indentation. Useful when editing source code. .TP -.BR \-k ", " \-\-cut +.BR \-k ", " \-\-cutfromcursor Make the 'Cut Text' command (normally \fB^K\fR) cut from the current cursor position to the end of the line, instead of cutting the entire line. .TP diff --git a/doc/nano.texi b/doc/nano.texi index 75dd58df..48e453f9 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -299,7 +299,7 @@ Automatically indent new lines to the same number of spaces and tabs as the previous line. @item -k -@itemx --cut +@itemx --cutfromcursor Make the 'Cut Text' command (normally @kbd{^K}) cut from the current cursor position to the end of the line, instead of cutting the entire line. @@ -598,7 +598,7 @@ The following global toggles are available: @kbd{Meta-I} toggles the @option{-i} (@option{--autoindent}) command-line option. @item Cut From Cursor To End-of-Line toggle -@kbd{Meta-K} toggles the @option{-k} (@option{--cut}) command-line option. +@kbd{Meta-K} toggles the @option{-k} (@option{--cutfromcursor}) command-line option. @item Long-Line Wrapping toggle @kbd{Meta-L} toggles the @option{-w} (@option{--nowrap}) command-line option. @@ -726,8 +726,9 @@ Constantly display the cursor position on the status bar. (The old form of this option, @code{set const}, is deprecated.) Note that this overrides @option{quickblank}. -@item set cut -Use cut-to-end-of-line by default, instead of cutting the whole line. +@item set cutfromcursor +Use cut-from-cursor-to-end-of-line by default, instead of cutting the whole line. +(The old form of this option, @code{set cut}, is deprecated.) @item set fill @var{number} Hard-wrap lines at column number @var{number}. If @var{number} is 0 or less, diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 88958928..14818f94 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -97,8 +97,9 @@ Constantly display the cursor position in the status bar. (The old form of this option, '\fBset const\fR', is deprecated.) This overrides the option \fBquickblank\fR. .TP -.B set cut -Use cut-to-end-of-line by default, instead of cutting the whole line. +.B set cutfromcursor +Use cut-from-cursor-to-end-of-line by default, instead of cutting the whole line. +(The old form of this option, '\fBset cut\fR', is deprecated.) .TP .B set fill \fInumber\fR Hard-wrap lines at column number \fInumber\fR. If \fInumber\fR is 0 or less, diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in index fc66a1d4..e41c6f71 100644 --- a/doc/sample.nanorc.in +++ b/doc/sample.nanorc.in @@ -53,8 +53,9 @@ # set constantshow ## (The old form, 'const', is deprecated.) -## Use cut-to-end-of-line by default. -# set cut +## Use cut-from-cursor-to-end-of-line by default. +# set cutfromcursor +## (The old form, 'cut', is deprecated.) ## Set the line length for wrapping text and justifying paragraphs. ## If the value is 0 or less, the wrapping point will be the screen diff --git a/src/nano.c b/src/nano.c index ac2e56bf..303ab5a4 100644 --- a/src/nano.c +++ b/src/nano.c @@ -864,7 +864,7 @@ void usage(void) print_opt("-h", "--help", N_("Show this help text and exit")); #ifndef NANO_TINY print_opt("-i", "--autoindent", N_("Automatically indent new lines")); - print_opt("-k", "--cut", N_("Cut from cursor to end of line")); + print_opt("-k", "--cutfromcursor", N_("Cut from cursor to end of line")); #endif #ifdef ENABLE_LINENUMBERS print_opt("-l", "--linenumbers", N_("Show line numbers in front of the text")); @@ -1977,7 +1977,7 @@ int main(int argc, char **argv) {"wordchars", 1, NULL, 'X'}, {"atblanks", 0, NULL, 'a'}, {"autoindent", 0, NULL, 'i'}, - {"cut", 0, NULL, 'k'}, + {"cutfromcursor", 0, NULL, 'k'}, {"unix", 0, NULL, 'u'}, {"softwrap", 0, NULL, '$'}, #endif diff --git a/src/rcfile.c b/src/rcfile.c index 8505e0c7..70e3e6a5 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -96,7 +96,8 @@ static const rcoption rcopts[] = { {"backupdir", 0}, {"backwards", BACKWARDS_SEARCH}, {"casesensitive", CASE_SENSITIVE}, - {"cut", CUT_TO_END}, + {"cut", CUT_TO_END}, /* deprecated form, remove in 2020 */ + {"cutfromcursor", CUT_TO_END}, {"justifytrim", JUSTIFY_TRIM}, {"locking", LOCKING}, {"matchbrackets", 0}, diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc index 1bdb13bd..ac1fa4ce 100644 --- a/syntax/nanorc.nanorc +++ b/syntax/nanorc.nanorc @@ -7,7 +7,7 @@ comment "#" icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|formatter|i?color|extendsyntax).*$" # Keywords -icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|atblanks|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cut|fill[[:space:]]+-?[[:digit:]]+|historylog|justifytrim|linenumbers|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[1-9][0-9]*|tabstospaces|tempfile|unix|view|wordbounds)\>" +icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|atblanks|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cutfromcursor|fill[[:space:]]+-?[[:digit:]]+|historylog|justifytrim|linenumbers|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[1-9][0-9]*|tabstospaces|tempfile|unix|view|wordbounds)\>" icolor yellow "^[[:space:]]*set[[:space:]]+((function|key|number|status|title)color)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|speller|statuscolor|titlecolor|whitespace|wordchars)[[:space:]]+" icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^([[:alpha:]]|[]0-9\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+(all|main|search|replace(with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"