summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
authorJosh Holland <anowlcalledjosh@gmail.com>2019-11-19 15:08:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-20 07:31:43 (GMT)
commit077a1fda82b237c16eb10bd988650468683a94b5 (patch)
tree3dc2a504b62249c0b4a7336a58d4e9dccee14660 /userdiff.c
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9 (diff)
downloadgit-077a1fda82b237c16eb10bd988650468683a94b5.zip
git-077a1fda82b237c16eb10bd988650468683a94b5.tar.gz
git-077a1fda82b237c16eb10bd988650468683a94b5.tar.bz2
userdiff: support Python async functions
Python's async functions (declared with "async def" rather than "def") were not being displayed in hunk headers. This commit teaches git about the async function syntax, and adds tests for the Python userdiff regex. Signed-off-by: Josh Holland <anowlcalledjosh@gmail.com> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/userdiff.c b/userdiff.c
index e74a6d4..057fdcc 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -124,7 +124,7 @@ PATTERNS("php",
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
"|[-+*/<>%&^|=!.]=|--|\\+\\+|<<=?|>>=?|===|&&|\\|\\||::|->"),
-PATTERNS("python", "^[ \t]*((class|def)[ \t].*)$",
+PATTERNS("python", "^[ \t]*((class|(async[ \t]+)?def)[ \t].*)$",
/* -- */
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"