mirror of git://git.sv.gnu.org/nano.git
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>
This commit is contained in:
parent
e1c2573c7a
commit
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
|
||||
|
|
Loading…
Reference in New Issue