Skip to content

Commit 7d63a53

Browse files
author
Michael Doronin
committed
highlight yield from as a keyword and await only if it is a keyword
1 parent bd24b62 commit 7d63a53

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

syntax/python.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ syn keyword pythonImport import
168168
syn keyword pythonImport from
169169
syn keyword pythonException try except finally
170170
syn keyword pythonOperator and in is not or
171+
syn match pythonStatement "^\s*yield\>" display
171172

172-
syn match pythonStatement "^\s*yield\>" display
173173

174174
if s:Python2Syntax()
175175
if !s:Enabled("g:python_print_as_function")
@@ -179,9 +179,9 @@ if s:Python2Syntax()
179179
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display contained
180180
else
181181
syn keyword pythonStatement as nonlocal
182-
syn match pythonStatement "\<yield\s\+from\>" display
182+
syn match pythonStatement "\v\s*<yield\s+from>" display
183183
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
184-
syn keyword pythonStatement await
184+
syn match pythonStatement "\v(\.)@<!<await>"
185185
syn match pythonStatement "\<async\s\+def\>" nextgroup=pythonFunction skipwhite
186186
syn match pythonStatement "\<async\s\+with\>" display
187187
syn match pythonStatement "\<async\s\+for\>" display

0 commit comments

Comments
 (0)