aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-09-20 09:48:42 +0200
committerOmar Polo <op@omarpolo.com>2021-09-20 09:48:42 +0200
commit874e7af5fb7b5ffc6981d53624c40c9c12b49ae8 (patch)
tree488668b9ce6998b1b54471998cb8467fa68aa037
parent328e791598d3c671e2bd13164515d8748f9aaf27 (diff)
downloadtelescope-874e7af5fb7b5ffc6981d53624c40c9c12b49ae8.tar.gz
telescope-874e7af5fb7b5ffc6981d53624c40c9c12b49ae8.tar.bz2
fix patch syntax highlighting wrt multiple headers
-rw-r--r--parser_textpatch.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/parser_textpatch.c b/parser_textpatch.c
index 36c5cdb..764be11 100644
--- a/parser_textpatch.c
+++ b/parser_textpatch.c
@@ -81,6 +81,18 @@ tpatch_emit_line(struct parser *p, const char *line, size_t linelen)
case '@':
l->type = LINE_PATCH_HUNK_HDR;
break;
+ case ' ':
+ /* context lines */
+ break;
+ default:
+ /*
+ * A single patch file can have more
+ * than one "header" if touches more
+ * than one file.
+ */
+ l->type = LINE_PATCH_HDR;
+ p->flags |= PARSER_IN_PATCH_HDR;
+ break;
}
if (has_prefix(l->line, "+++"))