(DLR)
- Don't set current_len until after it's been asserted that both
current and current->data aren't NULL. (DLR)
+- rcfile.c:
+ parse_colors()
+ - Properly parse a background color without a foreground color.
+ (DLR)
- search.c:
do_gotoline()
- Properly show an error message if we try to go to line 0,
- doc/faq.html:
- Update the question about the FAQ to mention the current
maintainer. (DLR)
+- doc/nanorc.sample:
+ - In the "nanorc" regexes, tweak the "color" regex to properly
+ color a line that specifies a background color without a
+ foreground color, and update the associated comments. (DLR)
- doc/man/fr/Makefile.am:
- Set mandir to @mandir@/fr, so French manpages get installed
where they belong (Jordi).
##
## To use multi-line regexes use the start="regex" end="regex" format.
##
-## If your system supports transparency, not specifying a background
-## color will use a transparent color. If you don't want this, be sure
-## to set the background color to black or white.
+## Not specifying a foreground color will use the default foreground
+## color. If your system supports transparency, not specifying a
+## background color will use a transparent color. If you don't want the
+## latter, be sure to set the background color to black or white.
##
# syntax "c-file" "\.(c|C|cc|cpp|h|H|hh|hpp)$"
# color red "\<[A-Z_]{2,}\>"
# color cyan "^ *(set|unset) +(view|whitespace)"
# color green "^ *(set|unset|syntax)\>"
## colors
-# color yellow "^ *color +(bright)?(white|black|red|blue|green|yellow|magenta|cyan)(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
+# color yellow "^ *color *(bright)?(white|black|red|blue|green|yellow|magenta|cyan)(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
# color magenta "^ *color\>" "\<(start|end)="
## strings
# color white "\"(\\.|[^\"])*\""
void parse_colors(char *ptr)
{
int fg, bg;
- bool bright = FALSE;
+ bool bright = FALSE, no_fgcolor = FALSE;
char *fgstr;
assert(ptr != NULL);
if (strchr(fgstr, ',') != NULL) {
char *bgcolorname;
+
strtok(fgstr, ",");
bgcolorname = strtok(NULL, ",");
+ if (bgcolorname == NULL) {
+ /* If we have a background color without a foreground color,
+ * parse it properly. */
+ bgcolorname = fgstr + 1;
+ no_fgcolor = TRUE;
+ }
if (strncasecmp(bgcolorname, "bright", 6) == 0) {
rcfile_error(
N_("Background color %s cannot be bright"),
} else
bg = -1;
- fg = color_to_int(fgstr, &bright);
+ if (!no_fgcolor) {
+ fg = color_to_int(fgstr, &bright);
- /* Don't try to parse screwed-up foreground colors. */
- if (fg == -1)
- return;
+ /* Don't try to parse screwed-up foreground colors. */
+ if (fg == -1)
+ return;
+ } else
+ fg = -1;
if (syntaxes == NULL) {
rcfile_error(