mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
vim-patch:ce1d196: runtime(vim): Update base syntax, improve :match highlighting (#34912)
- Match the range prefix separately as a count.
- Match an explicit count of 1, rarely used but seen in the wild.
- Allow whitespace between the count and command.
closes: vim/vim#17717
ce1d1969f3
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
@ -225,7 +225,7 @@ syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9E
|
|||||||
syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc
|
syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc
|
||||||
syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1
|
syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1
|
||||||
syn match vimCount contained "\d\+"
|
syn match vimCount contained "\d\+"
|
||||||
syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand
|
syn match vimIsCommand "\<\h\w*\>" nextgroup=vimBang contains=vimCommand
|
||||||
syn match vimBang contained "!"
|
syn match vimBang contained "!"
|
||||||
syn match vimWhitespace contained "\s\+"
|
syn match vimWhitespace contained "\s\+"
|
||||||
|
|
||||||
@ -1437,12 +1437,18 @@ endif
|
|||||||
|
|
||||||
" Match: {{{2
|
" Match: {{{2
|
||||||
" =====
|
" =====
|
||||||
syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone
|
syn match vimMatch "\<\%([1-3]\s*\)\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone contains=vimCount
|
||||||
syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
|
syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
|
||||||
syn case ignore
|
syn case ignore
|
||||||
syn keyword vimMatchNone contained none
|
syn keyword vimMatchNone contained none
|
||||||
syn case match
|
syn case match
|
||||||
syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
|
syn region vimMatchPattern contained
|
||||||
|
\ matchgroup=Delimiter
|
||||||
|
\ start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)"
|
||||||
|
\ skip="\\\\\|\\\z1"
|
||||||
|
\ end="\z1"
|
||||||
|
\ contains=@vimSubstList
|
||||||
|
\ oneline
|
||||||
|
|
||||||
" Normal: {{{2
|
" Normal: {{{2
|
||||||
" ======
|
" ======
|
||||||
|
Reference in New Issue
Block a user