support, pressing Ctrl-Z to suspend nano at the Linux console
with keypad(TRUE) generates Ctrl-Z instead of KEY_SUSPEND
(which is what ncurses generates then). (DLR)
+- rcfile.c:
+ parse_colors()
+ - Generate an error if we try to use a bright background color
+ in a nanorc file. (DLR; found by Brand Huntsman)
+ - Make sure all rcfile error messages are capitalized, for
+ consistency. (DLR)
- winio.c:
titlebar()
- Fix problem with the available space for a filename on the
- nanorc.sample:
- Remove duplicate "historylog" entry, remove "keypad" entry,
and add "rebinddelete" entry. (DLR)
+ - Update the regexes for nanorc files. (Brand Huntsman, slightly
+ modified by DLR)
+ - Fix one attempt at a bright background color. (DLR)
- AUTHORS
- Updated to show 1.2/1.3 maintainers.
# color blue "//.*"
# color blue start="/\*" end="\*/"
# color brightblue start="/\*\*" end="\*/"
-# color brightgreen,brightgreen "[ ]+$"
+# color green,brightgreen "[ ]+$"
## Here is an example for your .nanorc
##
-# syntax "nanorc" "[\.]*nanorc$"
-# color white "^ *(set|unset).*$"
-# color cyan "^ *(set|unset) (autoindent|backup|const|cut|fill|keypad|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|regexp|smooth|speller|suspend|tabsize|tempfile|historylog|view)"
-# color brightwhite "^ *syntax [^ ]*"
-# color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
-# color white "^ *color\>.*"
-# color yellow "^ *color (bright)?(white|black|red|blue|green|yellow|magenta|cyan)\>"
-# color magenta "^ *color\>"
-# color green "^#.*$"
+# syntax "nanorc" "(\.)?nanorc$"
+# color brightwhite "^ *(set|unset|syntax|color).*$"
+# color cyan "^ *(set|unset)([ ]+)(autoindent|backup|const|cut|fill|historylog|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|rebinddelete|regexp|smooth|speller|suspend|tabsize|tempfile|view)"
+# color green "^ *(set|unset|syntax)\>"
+# 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)="
+# color white "\"(\\.|[^\"])*\""
+# color blue "^ *#.*$"
ptr = NULL;
else
*ptr++ = '\0';
- rcfile_error(_("argument %s has unterminated \""), ptr_bak);
+ rcfile_error(_("Argument %s has unterminated \""), ptr_bak);
} else {
*last_quote = '\0';
ptr = last_quote + 1;
else if (!strcasecmp(colorname, "black"))
mcolor = COLOR_BLACK;
else {
- rcfile_error(_("color %s not understood.\n"
- "Valid colors are \"green\", \"red\", \"blue\", \n"
- "\"white\", \"yellow\", \"cyan\", \"magenta\" and \n"
- "\"black\", with the optional prefix \"bright\".\n"),
- colorname);
+ rcfile_error(_("Color %s not understood.\n"
+ "Valid colors are \"green\", \"red\", \"blue\", \n"
+ "\"white\", \"yellow\", \"cyan\", \"magenta\" and \n"
+ "\"black\", with the optional prefix \"bright\" \n"
+ "for foreground colors.\n"), colorname);
mcolor = -1;
}
return mcolor;
return;
if (*ptr != '"') {
- rcfile_error(_("regex strings must begin and end with a \" character\n"));
+ rcfile_error(_("Regex strings must begin and end with a \" character\n"));
return;
}
ptr++;
}
if (strstr(fgstr, ",")) {
+ char *bgcolorname;
strtok(fgstr, ",");
- bg = colortoint(strtok(NULL, ","), &bright);
+ bgcolorname = strtok(NULL, ",");
+ if (!strncasecmp(bgcolorname, "bright", 6)) {
+ rcfile_error(_("Background color %s cannot be bright"), bgcolorname);
+ return;
+ }
+ bg = colortoint(bgcolorname, &bright);
} else
bg = -1;
}
if (*ptr != '"') {
- rcfile_error(_("regex strings must begin and end with a \" character\n"));
+ rcfile_error(_("Regex strings must begin and end with a \" character\n"));
ptr = parse_next_regex(ptr);
continue;
}
if (*ptr != '"') {
rcfile_error(_
- ("regex strings must begin and end with a \" character\n"));
+ ("Regex strings must begin and end with a \" character\n"));
continue;
}
ptr++;
) {
if (*ptr == '\n' || *ptr == '\0') {
rcfile_error(_
- ("option %s requires an argument"),
+ ("Option %s requires an argument"),
rcopts[i].name);
continue;
}
* errors. */
j = (int)strtol(option, &first_error, 10);
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
- rcfile_error(_("requested fill size %d invalid"),
+ rcfile_error(_("Requested fill size %d invalid"),
j);
else
wrap_at = j;
* errors. */
j = (int)strtol(option, &first_error, 10);
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
- rcfile_error(_("requested tab size %d invalid"),
+ rcfile_error(_("Requested tab size %d invalid"),
j);
else
tabsize = j;