Remove trailing whitespace for top and bottom line (#269)

Fixes #268

Remove trailing whitespace for top and bottom line when uncommenting a sexy commented block.
This commit is contained in:
Jorge Marin
2016-11-15 16:20:51 +01:00
committed by Caleb Maclennan
parent e1af5dae7d
commit ecdde217c0

View File

@@ -1620,6 +1620,16 @@ function s:UncommentLinesSexy(topline, bottomline)
let theLine = s:SwapOuterPlaceHoldersForMultiPartDelims(theLine) let theLine = s:SwapOuterPlaceHoldersForMultiPartDelims(theLine)
call setline(bottomline, theLine) call setline(bottomline, theLine)
endif 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 endfunction
" Function: s:UncommentLineNormal(line) {{{2 " Function: s:UncommentLineNormal(line) {{{2