Skip to content

Commit 0ad21fd

Browse files
committed
Highlight class variables inside f-strings
Fixes #56
1 parent 2ccfb14 commit 0ad21fd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

syntax/python.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ else
103103
syn match pythonStatement '\<async\s\+def\>' nextgroup=pythonFunction skipwhite
104104
syn match pythonStatement '\<async\s\+with\>'
105105
syn match pythonStatement '\<async\s\+for\>'
106-
syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonFString,pythonRawString,pythonRawFString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType
106+
syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonFString,pythonRawString,pythonRawFString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType,pythonClassVar
107107
endif
108108

109109

tests/test.py

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ async def Test
251251
f"{f'{1+1}'}"
252252
'{{ }}'
253253
f"{"{test}"}" # FIXME: syntax error that should not be highlighted
254+
f'{self.__name__}
254255
255256
# Doctests.
256257

0 commit comments

Comments
 (0)