docs: slightly reword some of the descriptions around syntax highlighting

master
Benno Schulenberg 2019-08-09 19:16:16 +02:00
parent ee91c51e09
commit 94c9defde1
2 changed files with 21 additions and 24 deletions

View File

@ -989,7 +989,7 @@ powerful enough to fully parse a file. Nevertheless, regular
expressions can do a lot and are easy to make, so they are a expressions can do a lot and are easy to make, so they are a
good fit for a small editor like @command{nano}. good fit for a small editor like @command{nano}.
All regular expressions in @command{nano} are extended regular expressions All regular expressions in @command{nano} are POSIX extended regular expressions
(ERE). This means that @code{.}, @code{?}, @code{*}, @code{+}, @code{^}, (ERE). This means that @code{.}, @code{?}, @code{*}, @code{+}, @code{^},
@code{$}, and several other characters are special. @code{$}, and several other characters are special.
The period @code{.} matches any single character, The period @code{.} matches any single character,
@ -1021,7 +1021,7 @@ activated by using the @option{-Y} or @option{--syntax}
command-line option followed by the @var{name}. command-line option followed by the @var{name}.
The @code{default} syntax is special: it takes no @var{fileregex}, The @code{default} syntax is special: it takes no @var{fileregex},
and applies to files that don't match any syntax's @var{fileregex}. and applies to files that don't match any syntax's regexes.
The @code{none} syntax is reserved; specifying it on the The @code{none} syntax is reserved; specifying it on the
command line is the same as not having a syntax at all. command line is the same as not having a syntax at all.
@ -1053,25 +1053,24 @@ functions are disabled; for example, @t{""} for JSON.
The default value is @t{"#"}. The default value is @t{"#"}.
@item color @var{fgcolor},@var{bgcolor} "@var{regex}" @dots{} @item color @var{fgcolor},@var{bgcolor} "@var{regex}" @dots{}
Display all pieces of text that match the Paint all pieces of text that match the extended regular expression "regex"
extended regular expression "regex" with foreground color "fgcolor" and with the given foreground and background colors, at least one of which must
background color "bgcolor", at least one of which must be specified. be specified. Valid color names are:
Valid names for foreground and background color are:
@code{white}, @code{black}, @code{blue}, @code{green}, @code{white}, @code{black}, @code{blue}, @code{green},
@code{red}, @code{cyan}, @code{yellow}, @code{magenta}, and @code{normal} @code{red}, @code{cyan}, @code{yellow}, @code{magenta}, and @code{normal}
--- where @code{normal} means the default foreground or background color. --- where @code{normal} means the default foreground or background color.
You may use the prefix @code{bright} You may use the prefix @code{bright} for the foreground color to get a
to get a stronger color highlight for the foreground. If your stronger highlight.
terminal supports transparency, not specifying a "bgcolor" tells @command{nano} If your terminal supports transparency, not specifying a "bgcolor"
to attempt to use a transparent background. tells @command{nano} to attempt to use a transparent background.
@item icolor @var{fgcolor},@var{bgcolor} "@var{regex}" @dots{} @item icolor @var{fgcolor},@var{bgcolor} "@var{regex}" @dots{}
Same as above, except that the matching is case insensitive. Same as above, except that the matching is case insensitive.
@item color @var{fgcolor},@var{bgcolor} start="@var{fromrx}" end="@var{torx}" @item color @var{fgcolor},@var{bgcolor} start="@var{fromrx}" end="@var{torx}"
Display all pieces of text whose start matches extended regular expression Paint all pieces of text whose start matches extended regular expression
"fromrx" and whose end matches extended regular expression "torx" with "fromrx" and whose end matches extended regular expression "torx" with
foreground color "fgcolor" and background color "bgcolor", at least one of the given foreground and background colors, at least one of
which must be specified. This means that, after an initial instance of which must be specified. This means that, after an initial instance of
"fromrx", all text until the first instance of "torx" will be colored. "fromrx", all text until the first instance of "torx" will be colored.
This allows syntax highlighting to span multiple lines. This allows syntax highlighting to span multiple lines.

View File

@ -335,7 +335,7 @@ powerful enough to fully parse a file. Nevertheless, regular
expressions can do a lot and are easy to make, so they are a expressions can do a lot and are easy to make, so they are a
good fit for a small editor like \fBnano\fR. good fit for a small editor like \fBnano\fR.
.sp .sp
All regular expressions in \fBnano\fR are extended regular expressions (ERE). All regular expressions in \fBnano\fR are POSIX extended regular expressions.
This means that \fB.\fR, \fB?\fR, \fB*\fR, \fB+\fR, \fB^\fR, \fB$\fR, and This means that \fB.\fR, \fB?\fR, \fB*\fR, \fB+\fR, \fB^\fR, \fB$\fR, and
several other characters are special. several other characters are special.
The period \fB.\fR matches any single character, The period \fB.\fR matches any single character,
@ -397,25 +397,23 @@ function is disabled; for example, "" for JSON.
The default value is "\fB#\fP". The default value is "\fB#\fP".
.TP .TP
.BI "color " fgcolor , bgcolor " """ regex """ " \fR... .BI "color " fgcolor , bgcolor " """ regex """ " \fR...
Display all pieces of text that match Paint all pieces of text that match the extended regular expression
the extended regular expression \fIregex\fP with foreground color \fIregex\fP with the given foreground and background colors, at least
\fIfgcolor\fP and background color \fIbgcolor\fP, at least one of which one of which must be specified. Valid color names are:
must be specified. Valid names for foreground and background colors are:
.BR white ", " black ", " blue ", " green ", " red ", " .BR white ", " black ", " blue ", " green ", " red ", "
.BR cyan ", " yellow ", " magenta ", and " normal .BR cyan ", " yellow ", " magenta ", and " normal
-- where \fBnormal\fR means the default foreground or background color. -- where \fBnormal\fR means the default foreground or background color.
You may use the prefix \fBbright\fR to get a stronger color highlight for the You may use the prefix \fBbright\fR for the foreground color to get a
foreground. If your terminal supports transparency, not specifying a stronger highlight. If your terminal supports transparency, not specifying
\fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent a \fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent background.
background.
.TP .TP
.BI "icolor " fgcolor , bgcolor " """ regex """ " \fR... .BI "icolor " fgcolor , bgcolor " """ regex """ " \fR...
Same as above, except that the matching is case insensitive. Same as above, except that the matching is case insensitive.
.TP .TP
.BI "color " fgcolor , bgcolor " start=""" fromrx """ end=""" torx """ .BI "color " fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
Display all pieces of text whose start matches extended regular expression Paint all pieces of text whose start matches extended regular expression
\fIfromrx\fP and whose end matches extended regular expression \fItorx\fP with \fIfromrx\fP and whose end matches extended regular expression \fItorx\fP
foreground color \fIfgcolor\fP and background color \fIbgcolor\fP, with the given foreground and background colors,
at least one of which must be specified. This means that, after an at least one of which must be specified. This means that, after an
initial instance of \fIfromrx\fP, all text until the first instance of initial instance of \fIfromrx\fP, all text until the first instance of
\fItorx\fP will be colored. This allows syntax highlighting to span \fItorx\fP will be colored. This allows syntax highlighting to span