From 1fbe7596f8853b434d7e1e6b4cc3ec2e80f6f801 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 19 Apr 2017 13:44:00 +0200
Subject: [PATCH] options: allow -U (--quickblank) to be used in the tiny
 version

It takes almost no code and is a useful little improvement over Pico.
---
 src/nano.c   | 6 +-----
 src/rcfile.c | 2 +-
 src/winio.c  | 2 +-
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/nano.c b/src/nano.c
index ae044be2..7bb99202 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -836,9 +836,7 @@ void usage(void)
 #endif
     print_opt(_("-T <#cols>"), _("--tabsize=<#cols>"),
 	N_("Set width of a tab to #cols columns"));
-#ifndef NANO_TINY
     print_opt("-U", "--quickblank", N_("Do quick statusbar blanking"));
-#endif
     print_opt("-V", "--version", N_("Print version information and exit"));
 #ifndef NANO_TINY
     print_opt("-W", "--wordbounds",
@@ -1935,6 +1933,7 @@ int main(int argc, char **argv)
 #endif
 	{"restricted", 0, NULL, 'R'},
 	{"tabsize", 1, NULL, 'T'},
+	{"quickblank", 0, NULL, 'U'},
 	{"version", 0, NULL, 'V'},
 #ifndef DISABLE_COLOR
 	{"syntax", 1, NULL, 'Y'},
@@ -1981,7 +1980,6 @@ int main(int argc, char **argv)
 	{"poslog", 0, NULL, 'P'},  /* deprecated form, remove in 2018 */
 	{"positionlog", 0, NULL, 'P'},
 	{"smooth", 0, NULL, 'S'},
-	{"quickblank", 0, NULL, 'U'},
 	{"wordbounds", 0, NULL, 'W'},
 	{"wordchars", 1, NULL, 'X'},
 	{"autoindent", 0, NULL, 'i'},
@@ -2119,11 +2117,9 @@ int main(int argc, char **argv)
 		    exit(1);
 		}
 		break;
-#ifndef NANO_TINY
 	    case 'U':
 		SET(QUICK_BLANK);
 		break;
-#endif
 	    case 'V':
 		version();
 		exit(0);
diff --git a/src/rcfile.c b/src/rcfile.c
index c88975de..53abc681 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -77,6 +77,7 @@ static const rcoption rcopts[] = {
     {"punct", 0},
     {"quotestr", 0},
 #endif
+    {"quickblank", QUICK_BLANK},
     {"rebinddelete", REBIND_DELETE},
     {"rebindkeypad", REBIND_KEYPAD},
     {"regexp", USE_REGEXP},
@@ -99,7 +100,6 @@ static const rcoption rcopts[] = {
     {"locking", LOCKING},
     {"matchbrackets", 0},
     {"noconvert", NO_CONVERT},
-    {"quickblank", QUICK_BLANK},
     {"quiet", QUIET},
     {"showcursor", SHOW_CURSOR},
     {"smarthome", SMART_HOME},
diff --git a/src/winio.c b/src/winio.c
index a7f6c931..21f7c70f 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2178,13 +2178,13 @@ void statusline(message_type importance, const char *msg, ...)
 #ifndef NANO_TINY
     if (old_whitespace)
 	SET(WHITESPACE_DISPLAY);
+#endif
 
     /* If doing quick blanking, blank the statusbar after just one keystroke.
      * Otherwise, blank it after twenty-six keystrokes, as Pico does. */
     if (ISSET(QUICK_BLANK))
 	statusblank = 1;
     else
-#endif
 	statusblank = 26;
 }
 
-- 
GitLab