mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-13 12:13:47 -05:00
Allow commenting empty lines given configuration (#250)
* Allow commenting empty lines given configuration
If g:NERDCommentEmptyLines=1 then it will comment empty line, which is
useful when commenting blocks.
When uncommenting it will delete any trailing whitespace.
* Add documentation for NERDCommentEmptyLines
This commit is contained in:
committed by
Caleb Maclennan
parent
06c3184b2e
commit
e1aeec12be
@@ -1810,8 +1810,9 @@ function s:CanToggleCommentLine(forceNested, lineNum)
|
||||
return 0
|
||||
endif
|
||||
|
||||
" make sure we don't comment lines that are just spaces or tabs or empty.
|
||||
if theLine =~ "^[ \t]*$"
|
||||
" make sure we don't comment lines that are just spaces or tabs or empty,
|
||||
" unless configured otherwise
|
||||
if g:NERDCommentEmptyLines == 0 && theLine =~ "^[ \t]*$"
|
||||
return 0
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user