mirror of
https://github.com/preservim/nerdcommenter.git
synced 2024-12-12 21:44:02 +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
|
||||
for i in range(firstLine, lastLine)
|
||||
let theLine = getline(i)
|
||||
" if have one line no comment, then comment all lines
|
||||
if !s:IsInSexyComment(firstLine) && !s:IsCommentedFromStartOfLine(s:Left(), theLine) && !s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
|
||||
" if have one line no comment(not include blank/whitespace-only lines), then comment all lines
|
||||
if theLine =~ '[^ \t]\+' && !s:IsInSexyComment(firstLine) && !s:IsCommentedFromStartOfLine(s:Left(), theLine) && !s:IsCommentedFromStartOfLine(s:Left({'alt': 1}), theLine)
|
||||
let l:commentAllLines = 1
|
||||
break
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user