diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 97008a4..40e86ef 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -1620,6 +1620,16 @@ function s:UncommentLinesSexy(topline, bottomline) let theLine = s:SwapOuterPlaceHoldersForMultiPartDelims(theLine) call setline(bottomline, theLine) endif + + " remove trailing whitespaces for first and last line + if g:NERDTrimTrailingWhitespace == 1 + let theLine = getline(a:bottomline) + let theLine = s:TrimTrailingWhitespace(theLine) + call setline(a:bottomline, theLine) + let theLine = getline(a:topline) + let theLine = s:TrimTrailingWhitespace(theLine) + call setline(a:topline, theLine) + endif endfunction " Function: s:UncommentLineNormal(line) {{{2