fix for C/C++ alternative comments

This commit is contained in:
Cristiano De Michele
2021-11-10 18:19:33 +01:00
parent a65465d321
commit c7c99edfb7

View File

@@ -651,7 +651,7 @@ function! s:CommentBlock(top, bottom, lSide, rSide, forceNested) abort
"alternative delimiters (if THEY are) as the comment will be better and more "alternative delimiters (if THEY are) as the comment will be better and more
"accurate with multipart delimiters "accurate with multipart delimiters
let switchedDelims = 0 let switchedDelims = 0
if !s:Multipart() && g:NERDAllowAnyVisualDelims && s:AltMultipart() if !s:Multipart() && !g:NERDAllowAnyVisualDelims && s:AltMultipart()
let switchedDelims = 1 let switchedDelims = 1
call nerdcommenter#SwitchToAlternativeDelimiters(0) call nerdcommenter#SwitchToAlternativeDelimiters(0)
endif endif
@@ -1068,7 +1068,7 @@ function! s:CommentRegion(topLine, topCol, bottomLine, bottomCol, forceNested) a
"switch delimiters (if we can) if the current set isn't multipart "switch delimiters (if we can) if the current set isn't multipart
let switchedDelims = 0 let switchedDelims = 0
if !s:Multipart() && s:AltMultipart() && g:NERDAllowAnyVisualDelims if !s:Multipart() && s:AltMultipart() && !g:NERDAllowAnyVisualDelims
let switchedDelims = 1 let switchedDelims = 1
call nerdcommenter#SwitchToAlternativeDelimiters(0) call nerdcommenter#SwitchToAlternativeDelimiters(0)
endif endif