diff --git a/doc/nano.1 b/doc/nano.1 index ba983d62e3a301a09529e3dc4ce32dcd7d979ff8..155dbb4f6af92daa165d81fc8f40c9f5701975bc 100644 --- a/doc/nano.1 +++ b/doc/nano.1 @@ -164,6 +164,10 @@ should be considered as part of a word. This overrides option Specify the name of the syntax highlighting to use from among the ones defined in the \fInanorc\fP files. .TP +.BR \-a ", " \-\-atblanks +When doing soft line wrapping, wrap lines at whitespace +instead of always at the edge of the screen. +.TP .BR \-c ", " \-\-constantshow Constantly show the cursor position on the status bar. Note that this overrides option \fB\-U\fR (\fB\-\-quickblank\fR). @@ -256,7 +260,7 @@ continuing it over multiple screen lines. Since this option last when using other options (e.g.\& 'nano \-wS$') or pass it separately (e.g.\& 'nano \-wS \-$'). .TP -.BR \-a ", " \-b ", " \-e ", " \-f ", " \-j +.BR \-b ", " \-e ", " \-f ", " \-j Ignored, for compatibility with Pico. .SH TOGGLES diff --git a/doc/nano.texi b/doc/nano.texi index aad6b77a73fbae6a2f2458b4e836e8d8658a8821..aa90592eaf0fecaf0c68f6ee71a6aecb2257bcfb 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -246,6 +246,11 @@ should be considered as parts of words. This overrides option Specify the syntax to be used for highlighting. @xref{Syntax Highlighting} for more info. +@item -a +@itemx --atblanks +When doing soft line wrapping, wrap lines at whitespace +instead of always at the edge of the screen. + @item -c @itemx --constantshow Constantly display the cursor position (line number, column number, @@ -375,8 +380,7 @@ continuing it over multiple screen lines. Since this option last when using other options (e.g.@: @code{nano -wS$}) or pass it separately (e.g.@: @code{nano -wS -$}). -@item -a -@itemx -b +@item -b @itemx -e @itemx -f @itemx -j diff --git a/src/nano.c b/src/nano.c index 63ef707b11b2dfbddf92f180fb5a73faae644445..afc36586a4109ec1a77a3b4453825b4d25580ee9 100644 --- a/src/nano.c +++ b/src/nano.c @@ -850,6 +850,9 @@ void usage(void) if (!ISSET(RESTRICTED)) print_opt(_("-Y <name>"), _("--syntax=<name>"), 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", @@ -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': @@ -2127,6 +2130,11 @@ int main(int argc, char **argv) case 'Y': syntaxstr = mallocstrcpy(syntaxstr, optarg); break; +#endif +#ifndef NANO_TINY + case 'a': + SET(AT_BLANKS); + break; #endif case 'c': SET(CONSTANT_SHOW);