mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-10 10:43:48 -05:00
Make g:NERDToggleCheckAllLines not check blank/whitespace-only lines (#355)
This commit is contained in:
@@ -1271,8 +1271,8 @@ function! NERDComment(mode, type) range
|
|||||||
let l:commentAllLines = 0
|
let l:commentAllLines = 0
|
||||||
for i in range(firstLine, lastLine)
|
for i in range(firstLine, lastLine)
|
||||||
let theLine = getline(i)
|
let theLine = getline(i)
|
||||||
" if have one line no comment, then comment all lines
|
" if have one line no comment(not include blank/whitespace-only lines), then comment all lines
|
||||||
if !s:IsInSexyComment(firstLine) && !s:IsCommentedFromStartOfLine(s:Left(), theLine) && !s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
|
if theLine =~ '[^ \t]\+' && !s:IsInSexyComment(firstLine) && !s:IsCommentedFromStartOfLine(s:Left(), theLine) && !s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
|
||||||
let l:commentAllLines = 1
|
let l:commentAllLines = 1
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user