Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion plugin/NERD_commenter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,13 @@ function s:CommentLinesSexy(topline, bottomline)
while currentLine <= a:bottomline + !g:NERDCompactSexyComs
" get the line and convert the tabs to spaces
let theLine = getline(currentLine)

if s:IsCommentedFromStartOfLine("/", theLine) && s:HasCStyleComments()
let comMarker = sexyComMarker . s:spaceStr
else
let comMarker = sexyComMarkerSpaced
endif

let lineHasTabs = s:HasLeadingTabs(theLine)
if lineHasTabs
let theLine = s:ConvertLeadingTabsToSpaces(theLine)
Expand All @@ -1013,7 +1020,7 @@ function s:CommentLinesSexy(topline, bottomline)
endif

" add the sexyComMarker
let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . sexyComMarkerSpaced . strpart(theLine, leftAlignIndx)
let theLine = repeat(' ', leftAlignIndx) . repeat(' ', strlen(left)-strlen(sexyComMarker)) . comMarker . strpart(theLine, leftAlignIndx)

if lineHasTabs
let theLine = s:ConvertLeadingSpacesToTabs(theLine)
Expand Down