mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
vim-patch:ae321b5: runtime(vim): Update base-syntax, match shebang lines (vim/vim#15011) (#29351)
Match shebang lines in Vim9 and legacy script.
Mark these as an error if they appear anywhere other than the first line
of a legacy-script file. In Vim9 script these match as normal line
comments rather than an error.
ae321b51f7
Co-authored-by: dkearns <dougkearns@gmail.com>
This commit is contained in:
@@ -828,6 +828,12 @@ endif
|
|||||||
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
|
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
|
||||||
syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup
|
syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup
|
||||||
|
|
||||||
|
" allowed anywhere in the file
|
||||||
|
if !s:vim9script
|
||||||
|
syn match vimShebangError "^\s*\zs#!.*" display
|
||||||
|
endif
|
||||||
|
syn match vimShebang "\%^#!.*" display
|
||||||
|
|
||||||
syn match vimContinue "^\s*\zs\\"
|
syn match vimContinue "^\s*\zs\\"
|
||||||
syn match vimContinueComment '^\s*\zs["#]\\ .*'
|
syn match vimContinueComment '^\s*\zs["#]\\ .*'
|
||||||
syn cluster vimContinue contains=vimContinue,vimContinueComment
|
syn cluster vimContinue contains=vimContinue,vimContinueComment
|
||||||
@@ -1058,6 +1064,7 @@ if !exists("skip_vim_syntax_inits")
|
|||||||
hi def link vimHiCtermError vimError
|
hi def link vimHiCtermError vimError
|
||||||
hi def link vimHiKeyError vimError
|
hi def link vimHiKeyError vimError
|
||||||
hi def link vimMapModErr vimError
|
hi def link vimMapModErr vimError
|
||||||
|
hi def link vimShebangError vimError
|
||||||
hi def link vimSubstFlagErr vimError
|
hi def link vimSubstFlagErr vimError
|
||||||
hi def link vimSynCaseError vimError
|
hi def link vimSynCaseError vimError
|
||||||
hi def link vimSynFoldMethodError vimError
|
hi def link vimSynFoldMethodError vimError
|
||||||
@@ -1196,6 +1203,7 @@ if !exists("skip_vim_syntax_inits")
|
|||||||
hi def link vimSetSep Statement
|
hi def link vimSetSep Statement
|
||||||
hi def link vimSetString vimString
|
hi def link vimSetString vimString
|
||||||
hi def link vim9Vim9Script vimCommand
|
hi def link vim9Vim9Script vimCommand
|
||||||
|
hi def link vimShebang PreProc
|
||||||
hi def link vimSleep vimCommand
|
hi def link vimSleep vimCommand
|
||||||
hi def link vimSleepArg Constant
|
hi def link vimSleepArg Constant
|
||||||
hi def link vimSleepBang vimBang
|
hi def link vimSleepBang vimBang
|
||||||
|
Reference in New Issue
Block a user