hdima / python-syntax

Python syntax highlighting script for Vim
http://www.vim.org/scripts/script.php?script_id=790
MIT License
363 stars 109 forks source link

The identifier next to "async def" is not highlighted as function name #36

Closed achimnol closed 8 years ago

achimnol commented 8 years ago

..and the fix is:

diff --git a/syntax/python.vim b/syntax/python.vim
index e461241..4ad66b3 100644
--- a/syntax/python.vim
+++ b/syntax/python.vim
@@ -176,7 +176,7 @@ else
   syn keyword pythonBoolean     True False
   syn match   pythonFunction    "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
   syn keyword pythonStatement   await
-  syn match   pythonStatement   "\<async\s\+def\>" display
+  syn match   pythonStatement   "\<async\s\+def\>" nextgroup=pythonFunction skipwhite
   syn match   pythonStatement   "\<async\s\+with\>" display
   syn match   pythonStatement   "\<async\s\+for\>" display
   syn match   pythonStatement   "\<async\s\+with\>" display```
hdima commented 8 years ago

Thank you for the patch! Can you create a pull request?

hdima commented 8 years ago

Thank you! I've merged e4d992d