nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 19f71632c850acb04d8dff3033b59b3c9a8f9ae3
parent e3f18e7a6cef53785a17ac778283a4b1604174ce
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 14 Jun 2019 10:26:49 +0200

tweaks: remove an unneeded "closing" of a syntax after extending it

As 'extendsyntax' commands are no longer interpreted immediately when
the rcfiles are read, there is no need to set 'opensyntax' to FALSE
after interpreting such a command -- for a single syntax they are all
interpreted in a row.

Diffstat:
Msrc/rcfile.c | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -1029,6 +1029,8 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only) char *syntaxname = ptr; syntaxtype *sint; + opensyntax = FALSE; + ptr = parse_next_word(ptr); for (sint = syntaxes; sint != NULL; sint = sint->next) @@ -1038,14 +1040,12 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only) if (sint == NULL) { rcfile_error(N_("Could not find syntax \"%s\" to extend"), syntaxname); - opensyntax = FALSE; continue; } /* Disallow extending a syntax that is defined in a main nanorc. */ if (sint->filename == NULL) { rcfile_error(N_("Only an 'include' syntax can be extended")); - opensyntax = FALSE; continue; } @@ -1123,12 +1123,6 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only) else if (headers_only) rcfile_error(N_("Command \"%s\" not understood"), keyword); -#ifdef ENABLE_COLOR - /* If a syntax was extended, it stops at the end of the command. */ - if (!syntax_only && live_syntax != syntaxes) - opensyntax = FALSE; -#endif - if (set == 0) continue;