Skip to content

Commit 1f50053

Browse files
committed
Fix pythonRun and pythonCoding groups.
Thanks to @ZDBioHazard.
1 parent 0d3597f commit 1f50053

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

syntax/python.vim

+2-3
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ syn match pythonDot '\.' display containedin=pythonDottedName
136136

137137
syn match pythonComment '#.*$' display contains=pythonTodo,@Spell
138138
if !s:Enabled('g:python_highlight_file_headers_as_comments')
139-
syn match pythonRun '\%^#!.*$'
140-
syn match pythonCoding '\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$'
139+
syn match pythonRun '\%^#!.*$' nextgroup=pythonDocString skipempty
140+
syn match pythonCoding '\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$' nextgroup=pythonDocString skipempty
141141
endif
142142
syn keyword pythonTodo TODO FIXME XXX contained
143143

@@ -292,7 +292,6 @@ endif
292292

293293
" Docstrings
294294
syn match pythonColon ':' nextgroup=pythonDocString skipempty
295-
syn match pythonStartFile +\%^+ nextgroup=pythonDocString skipempty
296295
syn region pythonDocString start=+^\s*'''+ skip=+\\'+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
297296
syn region pythonDocString start=+^\s*"""+ skip=+\\"+ end=+"""+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
298297
syn region pythonString start=+^\s*'''+ skip=+\\'+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell

0 commit comments

Comments
 (0)