>From 9a26904bff89334b82f57f8bea05c7a6a548c171 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 28 Jun 2017 16:57:46 +0200 Subject: [PATCH] options: recognize -a and --atblanks on the command line In nano -a is only effective when -$ is also given, so this will not conflict with Pico since Pico does not know the -$ option. --- src/nano.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nano.c b/src/nano.c index e29fa91b..f17ccdcd 100644 --- a/src/nano.c +++ b/src/nano.c @@ -851,6 +851,9 @@ void usage(void) print_opt(_("-Y "), _("--syntax="), N_("Syntax definition to use for coloring")); #endif +#ifndef NANO_TINY + print_opt("-a", "--atblanks", N_("When soft-wrapping, do it at whitespace")); +#endif print_opt("-c", "--constantshow", N_("Constantly show cursor position")); print_opt("-d", "--rebinddelete", N_("Fix Backspace/Delete confusion problem")); @@ -1972,6 +1975,7 @@ int main(int argc, char **argv) {"smooth", 0, NULL, 'S'}, {"wordbounds", 0, NULL, 'W'}, {"wordchars", 1, NULL, 'X'}, + {"atblanks", 0, NULL, 'a'}, {"autoindent", 0, NULL, 'i'}, {"cut", 0, NULL, 'k'}, {"unix", 0, NULL, 'u'}, @@ -2024,7 +2028,6 @@ int main(int argc, char **argv) "ABC:DEFGHIKLNOPQ:RST:UVWX:Y:abcdefghijklmno:pqr:s:tuvwxz$", long_options, NULL)) != -1) { switch (optchr) { - case 'a': case 'b': case 'e': case 'f': @@ -2128,6 +2131,11 @@ int main(int argc, char **argv) syntaxstr = mallocstrcpy(syntaxstr, optarg); break; #endif +#ifndef NANO_TINY + case 'a': + SET(AT_BLANKS); + break; +#endif case 'c': SET(CONSTANT_SHOW); break; -- 2.13.1