mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-01-23 02:10:50 +08:00
can enable TrimTrailingWhitespace when comment
This commit is contained in:
parent
c3d6a2069b
commit
45689b2356
|
@ -746,6 +746,10 @@ function s:CommentBlock(top, bottom, lSide, rSide, forceNested )
|
|||
let theLine = s:ConvertLeadingSpacesToTabs(theLine)
|
||||
endif
|
||||
|
||||
if g:NERDTrimTrailingWhitespace == 1
|
||||
let theLine = s:TrimTrailingWhitespace(theLine)
|
||||
endif
|
||||
|
||||
call setline(currentLine, theLine)
|
||||
endif
|
||||
|
||||
|
@ -816,6 +820,10 @@ function s:CommentLines(forceNested, align, firstLine, lastLine)
|
|||
let theLine = s:ConvertLeadingSpacesToTabs(theLine)
|
||||
endif
|
||||
|
||||
if g:NERDTrimTrailingWhitespace == 1
|
||||
let theLine = s:TrimTrailingWhitespace(theLine)
|
||||
endif
|
||||
|
||||
" we are done with this line
|
||||
call setline(currentLine, theLine)
|
||||
let currentLine = currentLine + 1
|
||||
|
@ -876,6 +884,11 @@ function s:CommentLinesMinimal(firstLine, lastLine)
|
|||
if lineHasLeadingTabs
|
||||
let theLine = s:ConvertLeadingSpacesToTabs(theLine)
|
||||
endif
|
||||
|
||||
if g:NERDTrimTrailingWhitespace == 1
|
||||
let theLine = s:TrimTrailingWhitespace(theLine)
|
||||
endif
|
||||
|
||||
call setline(a:lastLine, theLine)
|
||||
endfunction
|
||||
|
||||
|
@ -995,6 +1008,9 @@ function s:CommentLinesSexy(topline, bottomline)
|
|||
let theLine = s:ConvertLeadingSpacesToTabs(theLine)
|
||||
endif
|
||||
|
||||
if g:NERDTrimTrailingWhitespace == 1
|
||||
let theLine = s:TrimTrailingWhitespace(theLine)
|
||||
endif
|
||||
|
||||
" set the line and move onto the next one
|
||||
call setline(currentLine, theLine)
|
||||
|
@ -1049,6 +1065,10 @@ function s:CommentLinesToggle(forceNested, firstLine, lastLine)
|
|||
let theLine = s:ConvertLeadingSpacesToTabs(theLine)
|
||||
endif
|
||||
|
||||
if g:NERDTrimTrailingWhitespace == 1
|
||||
let theLine = s:TrimTrailingWhitespace(theLine)
|
||||
endif
|
||||
|
||||
" we are done with this line
|
||||
call setline(currentLine, theLine)
|
||||
let currentLine = currentLine + 1
|
||||
|
|
Loading…
Reference in New Issue
Block a user