startup: when an rcfile contains errors, report this on the status bar
Suggested-by: Brand Huntsman <alpha@qzx.com>
Этот коммит содержится в:
родитель
c3a11fb7ed
Коммит
1463781247
@ -242,6 +242,8 @@ int interface_color_pair[] = {0};
|
||||
|
||||
char *homedir = NULL;
|
||||
/* The user's home directory, from $HOME or /etc/passwd. */
|
||||
char *rcfile_with_errors = NULL;
|
||||
/* The first nanorc file, if any, that produced warnings. */
|
||||
|
||||
|
||||
/* Return the number of entries in the shortcut list for a given menu. */
|
||||
|
@ -2594,6 +2594,9 @@ int main(int argc, char **argv)
|
||||
|
||||
prepare_for_display();
|
||||
|
||||
if (rcfile_with_errors != NULL)
|
||||
statusline(ALERT, _("Mistakes in '%s'"), rcfile_with_errors);
|
||||
|
||||
while (TRUE) {
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
int needed_margin = digits(openfile->filebot->lineno) + 1;
|
||||
|
@ -181,6 +181,7 @@ extern char* specified_color_combo[NUMBER_OF_ELEMENTS];
|
||||
extern int interface_color_pair[NUMBER_OF_ELEMENTS];
|
||||
|
||||
extern char *homedir;
|
||||
extern char *rcfile_with_errors;
|
||||
|
||||
typedef void (*functionptrtype)(void);
|
||||
|
||||
|
@ -141,6 +141,9 @@ void rcfile_error(const char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (rcfile_with_errors == NULL)
|
||||
rcfile_with_errors = strdup(nanorc);
|
||||
|
||||
if (lineno > 0)
|
||||
fprintf(stderr, _("Error in %s on line %lu: "), nanorc, (unsigned long)lineno);
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user