@@ -16,6 +16,9 @@ call pymode#default('g:pymode_syntax_all', 1)
16
16
17
17
" Highlight 'print' as function
18
18
call pymode#default (" g:pymode_syntax_print_as_function" , 0 )
19
+ "
20
+ " Highlight 'async/await' keywords
21
+ call pymode#default (" g:pymode_syntax_highlight_async_await" , g: pymode_syntax_all )
19
22
20
23
" Highlight '=' operator
21
24
call pymode#default (' g:pymode_syntax_highlight_equal_operator' , g: pymode_syntax_all )
75
78
syn keyword pythonStatement yield
76
79
syn keyword pythonLambdaExpr lambda
77
80
syn keyword pythonStatement with as
78
- syn keyword pythonStatement async await
79
81
80
82
syn keyword pythonStatement def nextgroup =pythonFunction skipwhite
81
- syn match pythonStatement " \< async\s\+ def\> " nextgroup =pythonFunction skipwhite
82
- syn match pythonStatement " \< async\s\+ with\> " display
83
- syn match pythonStatement " \< async\s\+ for\> " nextgroup =pythonRepeat skipwhite
84
83
syn match pythonFunction " \% (\% (def\s\| @\)\s *\)\@ <=\h\% (\w\|\.\) *" contained nextgroup =pythonVars
85
84
syn region pythonVars start =" (" skip =+ \( ".*"\| '.*'\) + end =" )" contained contains =pythonParameters transparent keepend
86
85
syn match pythonParameters " [^,]*" contained contains =pythonParam skipwhite
@@ -105,6 +104,13 @@ endif
105
104
syn keyword pythonStatement print
106
105
endif
107
106
107
+ if g: pymode_syntax_highlight_async_await
108
+ syn keyword pythonStatement async await
109
+ syn match pythonStatement " \< async\s\+ def\> " nextgroup =pythonFunction skipwhite
110
+ syn match pythonStatement " \< async\s\+ with\> " display
111
+ syn match pythonStatement " \< async\s\+ for\> " nextgroup =pythonRepeat skipwhite
112
+ endif
113
+
108
114
if g: pymode_syntax_highlight_equal_operator
109
115
syn match pythonExtraOperator " \% (=\) "
110
116
endif
0 commit comments