vim-cmake-syntax
vim-cmake-syntax copied to clipboard
Fix syntax highlighting for bracket arguments and comments
Auxiliary/vim/syntax/cmake.vim incorrectly defines cmakeBracketArguement, cmakeComment and cmakeBracketArgument as
syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell
syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
cmakeBracketArgument doesn't match valid bracket argument containing more than one = in opening bracket, e.g., [==[...]==], and mismatches invalid text such as [=0123[...]=0123].
cmakeBracketComment should start with #.
cmakeComment mismatches and overrides bracket comment.
The correct syntaxs should look like
syn region cmakeBracketArgument start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
syn region cmakeComment start="#\(\[=*\[\)\@!" end="$" contains=cmakeTodo,@Spell
syn region cmakeBracketComment start="#\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
The change in syntax/cmake.vim is going to be merged into CMake: merge request and issue.