[PATCH 2/4] options: accept --solosidescroll and 'set solosidescroll'
Benno Schulenberg <[email protected]> Sun, 18 Jan 2026 10:56:22 +0100
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
These options activate the old, jerky, single-line sideways scrolling
instead of the new default smooth whole-window sideways scrolling.
---
src/nano.c | 7 ++++++-
syntax/nanorc.nanorc | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/nano.c b/src/nano.c
index 66cb4d31..92ebf39f 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -654,6 +654,7 @@ void usage(void)
print_opt("-0", "--zero", N_("Hide all bars, use whole terminal"));
#endif
print_opt("-/", "--modernbindings", N_("Use better-known key bindings"));
+ print_opt("-1", "--solosidescroll", N_("Scroll only the current line sideways"));
}
/* Display the version number of this nano, a copyright notice, some contact
@@ -1809,6 +1810,7 @@ int main(int argc, char **argv)
{"listsyntaxes", 0, NULL, 'z'},
#endif
{"modernbindings", 0, NULL, '/'},
+ {"solosidescroll", 0, NULL, '1'},
#ifndef NANO_TINY
{"smarthome", 0, NULL, 'A'},
{"backup", 0, NULL, 'B'},
@@ -1886,7 +1888,7 @@ int main(int argc, char **argv)
SET(RESTRICTED);
while ((optchr = getopt_long(argc, argv, "ABC:DEFGHIJ:KLMNOPQ:RST:UVWX:Y:Z"
- "abcdef:ghijklmno:pqr:s:tuvwxyz!@%_0/", long_options, NULL)) > 0) {
+ "abcdef:ghijklmno:pqr:s:tuvwxyz!@%_01/", long_options, NULL)) > 0) {
switch (optchr) {
#ifndef NANO_TINY
case 'A':
@@ -2151,6 +2153,9 @@ int main(int argc, char **argv)
case '/':
SET(MODERN_BINDINGS);
break;
+ case '1':
+ SET(SOLO_SIDESCROLL);
+ break;
default:
printf(_("Type '%s -h' for a list of available options.\n"), argv[0]);
exit(1);
diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc
index 0c16a6be..6e96c2d2 100644
--- a/syntax/nanorc.nanorc
+++ b/syntax/nanorc.nanorc
@@ -14,7 +14,7 @@ color bold,purple "^[[:blank:]]*include[[:blank:]]+[^[:blank:]"]+"
color lime "^[[:blank:]]*extendsyntax[[:blank:]]+[[:alpha:]]+[[:blank:]]+(i?color|header|magic|comment|formatter|linter|tabgives)[[:blank:]]+.*"
# The arguments of commands
-color brightgreen "^[[:blank:]]*(set|unset)[[:blank:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|bookstyle|breaklonglines|casesensitive|colonparsing|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|minibar|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|stateflags|tabstospaces|trimblanks|unix|whitespacedisplay|wordbounds|zap|zero)\>"
+color brightgreen "^[[:blank:]]*(set|unset)[[:blank:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|bookstyle|breaklonglines|casesensitive|colonparsing|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|minibar|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|solosidescroll|stateflags|tabstospaces|trimblanks|unix|whitespacedisplay|wordbounds|zap|zero)\>"
color brightgreen "^[[:blank:]]*set[[:blank:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|minicolor|numbercolor|operatingdir|promptcolor|punct|quotestr|scrollercolor|selectedcolor|speller|spotlightcolor|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:blank:]]+"
color brightgreen "^[[:blank:]]*set[[:blank:]]+(fill[[:blank:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:blank:]]+[1-9][0-9]*)\>"
color brightgreen "^[[:blank:]]*bind[[:blank:]]+((\^([[:alpha:]]|[]/@\^_`-]|Space)|([Ss][Hh]-)?[Mm]-[[:alpha:]]|[Mm]-([][!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-9]|2[0-4])|Ins|Del)[[:blank:]]+([[:lower:]]+|".*")[[:blank:]]+(main|help|search|replace(with)?|yesno|gotoline|writeout|insert|execute|browser|whereisfile|gotodir|spell|linter|all)\>"
--
2.51.2