mirror of
https://github.com/preservim/nerdcommenter.git
synced 2024-12-04 23:13:51 +08:00
Make g:NERDToggleCheckAllLines not check blank/whitespace-only lines (#355)
This commit is contained in:
parent
f46226bcd6
commit
67950d4b5d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user