diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-06-12 10:22:22 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-06-12 10:22:50 +0800 |
commit | c7799b1a23f82128e793448165ae88b403f9ef17 (patch) | |
tree | 7179f6b52db3f60af5f958920893a918d01d68f2 /runtime/syntax/vim.vim | |
parent | 66a1e028e6edfc26e9546f1c68f3e4bdf159511e (diff) | |
download | rneovim-c7799b1a23f82128e793448165ae88b403f9ef17.tar.gz rneovim-c7799b1a23f82128e793448165ae88b403f9ef17.tar.bz2 rneovim-c7799b1a23f82128e793448165ae88b403f9ef17.zip |
vim-patch:059cbe8: runtime(vim): Update base-syntax, match multiline continued comments (vim/vim#13936)
Match multiline (continued) line comments.
Continued tail comments are not supported yet.
https://github.com/vim/vim/commit/059cbe8933550e4f2b10ab564fb4398e95280198
Co-authored-by: dkearns <dougkearns@gmail.com>
Diffstat (limited to 'runtime/syntax/vim.vim')
-rw-r--r-- | runtime/syntax/vim.vim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 6cb75f3af4..d916a666c9 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -806,16 +806,17 @@ syn match vimCtrlChar "[--]" " Beginners - Patterns that involve ^ {{{2 " ========= if s:vim9script - syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained - syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle + syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle + syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained else - syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle - syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained + syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle + syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained 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 + syn match vimContinue "^\s*\zs\\" -syn match vimContinueComment '^\s*\zs["#]\\ .*' contained +syn match vimContinueComment '^\s*\zs["#]\\ .*' syn cluster vimContinue contains=vimContinue,vimContinueComment syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained |