2 Commits

Author SHA1 Message Date
Cristiano De Michele
b4a57a0b4f Merge c7c99edfb7 into 3f860f2d98 2024-08-08 12:33:56 +03:00
Cristiano De Michele
c7c99edfb7 fix for C/C++ alternative comments 2021-11-10 18:19:33 +01:00

View File

@@ -406,7 +406,6 @@ let s:delimiterMap = {
\ 'texmf': { 'left': '%' },
\ 'tf': { 'left': '#' },
\ 'tidy': { 'left': '#' },
\ 'tjp': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'tla': { 'left': '\\*', 'leftAlt': '(*', 'rightAlt': '*)' },
\ 'tli': { 'left': '#' },
\ 'tmux': { 'left': '#' },
@@ -422,7 +421,6 @@ let s:delimiterMap = {
\ 'txt2tags': { 'left': '%' },
\ 'typescript': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'typescriptreact': { 'left': '//', 'leftAlt': '{/*', 'rightAlt': '*/}' },
\ 'typst': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'uc': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' },
\ 'uc4': { 'left': '!' },
\ 'uil': { 'left': '!' },
@@ -667,7 +665,7 @@ function! s:CommentBlock(top, bottom, lSide, rSide, forceNested) abort
"alternative delimiters (if THEY are) as the comment will be better and more
"accurate with multipart delimiters
let switchedDelims = 0
if !s:Multipart() && g:NERDAllowAnyVisualDelims && s:AltMultipart()
if !s:Multipart() && !g:NERDAllowAnyVisualDelims && s:AltMultipart()
let switchedDelims = 1
call nerdcommenter#SwitchToAlternativeDelimiters(0)
endif
@@ -1084,7 +1082,7 @@ function! s:CommentRegion(topLine, topCol, bottomLine, bottomCol, forceNested) a
"switch delimiters (if we can) if the current set isn't multipart
let switchedDelims = 0
if !s:Multipart() && s:AltMultipart() && g:NERDAllowAnyVisualDelims
if !s:Multipart() && s:AltMultipart() && !g:NERDAllowAnyVisualDelims
let switchedDelims = 1
call nerdcommenter#SwitchToAlternativeDelimiters(0)
endif