options: allow -U (--quickblank) to be used in the tiny version

It takes almost no code and is a useful little improvement over Pico.
master
Benno Schulenberg 2017-04-19 13:44:00 +02:00
parent 3c875f9b59
commit 1fbe7596f8
3 changed files with 3 additions and 7 deletions

View File

@ -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);

View File

@ -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},

View File

@ -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;
}