Update CPlusPlus and Doxygen formats to be better.

Now the `'*'` characters in fixed-width blocks show up correctly,
with respect to how I write code.  (I think doxygen also swallows
them anyhow, so the highlighting is more consistent with doxygen's
parser.)

Also on loading a file, everything looks better now.
This commit is contained in:
2018-07-02 12:57:28 -04:00
parent 0058505789
commit 3d32ed613f
2 changed files with 15 additions and 12 deletions

View File

@ -7,13 +7,13 @@ syn include @cxxInDoxygen syntax/cpp.vim
unlet b:current_syntax
" This enables Basic C++ support, with my extensions.
let c_no_bracket_error=1
let c_no_curly_error=1
if version < 600
so <sfile>:p:h/cpp.vim
else
runtime! syntax/cpp.vim
endif
"let c_no_bracket_error=1
"let c_no_curly_error=1
"if version < 600
" so <sfile>:p:h/cpp.vim
"else
" runtime! syntax/cpp.vim
"endif
if exists("b:current_syntax")
unlet b:current_syntax

View File

@ -8,17 +8,19 @@ if exists("b:current_syntax")
unlet b:current_syntax
endif
syn match blueCommentStar "^[ ]*\*[ ]*" contained containedin=doxygenBriefLine,doxygenFixedWidth,@doxyNestedCxx
" Make all C++ code in a doxygen block look kinda like natural C++
"syn match doxygenSpecialMultilineDesc "`"
syn cluster doxyNestedCXX contains=@cxxInDoxygen,doxygenSpecialContinueComment,doxygenSpecialContinueCommentWhite
syn cluster doxyNestedCXX contains=@cxxInDoxygen,blueCommentStar
syn cluster doxyNeedsFixedWidth contains=doxygenBody,doxygenSpecialMultilineDesc,doxygenBriefLine,doxygenBrief
syn region doxygenFixedWidth containedin=doxygenBody matchgroup=Comment start=+^[ ]*\** *@code$+ skip=+^\n+ keepend end=+^[ ]*\** *@endcode$+ contains=@doxyNestedCXX
syn region doxygenFixedWidth containedin=@doxyNeedsFixedWidth matchgroup=Comment start=+@code+ skip=+^\n+ keepend end=+@endcode+ contains=@doxyNestedCXX
syn region doxygenFixedWidth containedin=doxygenBody matchgroup=Comment start=+^[ ]*\** *\~\~\~$+ skip=+^\n+ end=+^[ ]*\** *\~\~\~$+ contains=@doxyNestedCXX
syn region doxygenFixedWidth containedin=@doxyNeedsFixedWidth matchgroup=Comment start=+\~\~\~+ skip=+^\n+ end=+\~\~\~+ contains=@doxyNestedCXX
syn region doxygenFixedWidth containedin=doxygenBody matchgroup=Comment start=+`+ end=+`+ keepend contains=@doxyNestedCXX
syn region doxygenFixedWidth containedin=@doxyNeedsFixedWidth matchgroup=Comment start=+`+ end=+`+ keepend contains=@doxyNestedCXX
"syn match doxygenFixedWidth +`.\+`+ contained
@ -30,3 +32,4 @@ syn region doxygenFixedWidth containedin=doxygenBody matchgroup=Comment start=+`
" +\(\<[npcbea]\>\|\<em\>\|\<ref\|\<link\>\>\|\<f\$\|[$\\&<>#]\)\@!+ nextgroup=doxygenParam,doxygenRetval,doxygenBriefWord,doxygenBold,doxygenBOther,doxygenOther,doxygenOtherTODO,doxygenOtherWARN,doxygenOtherBUG,doxygenPage,doxygenGroupDefine,doxygenCodeRegion,doxygenVerbatimRegion,doxygenDotRegion
hi link doxygenFixedWidth None
hi link blueCommentStar doxygenSpecialContinueComment