WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 68987ee

Browse files
committed
feat: Explicitly set marker for sexy comments
Instead of extract the marker from last char of longest left comment allow to explicity set it
1 parent a462bbd commit 68987ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autoload/nerdcommenter.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,10 @@ function! nerdcommenter#SetUp() abort
490490

491491
if has_key(s:delimiterMap, filetype)
492492
let b:NERDCommenterDelims = copy(s:delimiterMap[filetype])
493+
if has_key(b:NERDCommenterDelims, 'marker')
494+
let b:NERDSexyComMarker = b:NERDCommenterDelims['marker']
495+
let b:NERDSexyComMarkerSet = 1
496+
endif
493497
for i in ['left', 'leftAlt', 'right', 'rightAlt']
494498
if !has_key(b:NERDCommenterDelims, i)
495499
let b:NERDCommenterDelims[i] = ''
@@ -2242,7 +2246,7 @@ function! s:GetSexyComMarker(space, esc) abort
22422246
let sexyComMarker = b:NERDSexyComMarker
22432247

22442248
"if there is no hardcoded marker then we find one
2245-
if sexyComMarker ==# ''
2249+
if b:NERDSexyComMarkerSet == 0 && sexyComMarker ==# ''
22462250

22472251
"if the filetype has c style comments then use standard c sexy
22482252
"comments

0 commit comments

Comments
 (0)