File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -628,6 +628,10 @@ Highlight "print" as a function *'g:pymode_syntax_print_as_function'*
628628>
629629 let g:pymode_syntax_print_as_function = 0
630630
631+ Highlight "async/await" keywords *'g:pymode_syntax_highlight_async_await'*
632+ >
633+ let g:pymode_syntax_highlight_async_await = g:pymode_syntax_all
634+
631635 Highlight '=' operator *'g:pymode_syntax_highlight_equal_operator'*
632636>
633637 let g:pymode_syntax_highlight_equal_operator = g:pymode_syntax_all
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ call pymode#default('g:pymode_syntax_all', 1)
1616
1717" Highlight 'print' as function
1818call 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 )
1922
2023" Highlight '=' operator
2124call pymode#default (' g:pymode_syntax_highlight_equal_operator' , g: pymode_syntax_all )
@@ -101,6 +104,13 @@ endif
101104 syn keyword pythonStatement print
102105 endif
103106
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+
104114 if g: pymode_syntax_highlight_equal_operator
105115 syn match pythonExtraOperator " \% (=\) "
106116 endif
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ describe 'pymode-syntax'
1313 Expect g: pymode_syntax == 1
1414 Expect g: pymode_syntax_all == 1
1515 Expect g: pymode_syntax_print_as_function == 0
16+ Expect g: pymode_syntax_highlight_async_await == 1
1617 Expect g: pymode_syntax_highlight_equal_operator == 1
1718 Expect g: pymode_syntax_highlight_stars_operator == 1
1819 Expect g: pymode_syntax_highlight_self == 1
You can’t perform that action at this time.
0 commit comments