mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
runtime(vim): Update base-syntax, match shebang lines (#15011)
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. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-jp/syntax-vim-ex
|
||||
" Last Change: 2024 Jun 14
|
||||
" Last Change: 2024 Jun 15
|
||||
" Former Maintainer: Charles E. Campbell
|
||||
|
||||
" DO NOT CHANGE DIRECTLY.
|
||||
@@ -834,6 +834,12 @@ endif
|
||||
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
|
||||
|
||||
" 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 vimContinueComment '^\s*\zs["#]\\ .*'
|
||||
syn cluster vimContinue contains=vimContinue,vimContinueComment
|
||||
@@ -1060,6 +1066,7 @@ if !exists("skip_vim_syntax_inits")
|
||||
hi def link vimHiCtermError vimError
|
||||
hi def link vimHiKeyError vimError
|
||||
hi def link vimMapModErr vimError
|
||||
hi def link vimShebangError vimError
|
||||
hi def link vimSubstFlagErr vimError
|
||||
hi def link vimSynCaseError vimError
|
||||
hi def link vimSynFoldMethodError vimError
|
||||
@@ -1198,6 +1205,7 @@ if !exists("skip_vim_syntax_inits")
|
||||
hi def link vimSetSep Statement
|
||||
hi def link vimSetString vimString
|
||||
hi def link vim9Vim9Script vimCommand
|
||||
hi def link vimShebang PreProc
|
||||
hi def link vimSleep vimCommand
|
||||
hi def link vimSleepArg Constant
|
||||
hi def link vimSleepBang vimBang
|
||||
|
Reference in New Issue
Block a user