1
1

rcfile: for an empty syntax, show the line number of the 'syntax' command

When reporting a syntax without any color commands, show the line number
of the relevant 'syntax' command instead of the line number where the
emptiness is concluded, because the latter can be many lines later.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
Этот коммит содержится в:
Brand Huntsman 2019-07-08 20:54:04 -06:00 коммит произвёл Benno Schulenberg
родитель e1c2573c7a
Коммит 304f07258b

Просмотреть файл

@ -362,8 +362,13 @@ void begin_new_syntax(char *ptr)
void check_for_nonempty_syntax(void)
{
#ifdef ENABLE_COLOR
if (opensyntax && !seen_color_command)
if (opensyntax && !seen_color_command) {
size_t current_lineno = lineno;
lineno = live_syntax->lineno;
jot_error(N_("Syntax \"%s\" has no color commands"), live_syntax->name);
lineno = current_lineno;
}
opensyntax = FALSE;
#endif