mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-02-21 19:34:09 +08:00
bugfix: stopped infine loop when checking for sexy comment on first/last line of file
This commit is contained in:
parent
75f5b5f275
commit
f5092782ee
@ -2325,12 +2325,12 @@ function s:FindBoundingLinesOfSexyCom(lineNum)
|
||||
let theLine = getline(currentLine)
|
||||
|
||||
"check if the current line is the top of the sexy comment
|
||||
if theLine =~ '^[ \t]*' . left && theLine !~ '.*' . right
|
||||
if theLine =~ '^[ \t]*' . left && theLine !~ '.*' . right && currentLine < s:NumLinesInBuf()
|
||||
let top = currentLine
|
||||
let currentLine = a:lineNum
|
||||
|
||||
"check if the current line is the bottom of the sexy comment
|
||||
elseif theLine =~ '^[ \t]*' . right && theLine !~ '.*' . left
|
||||
elseif theLine =~ '^[ \t]*' . right && theLine !~ '.*' . left && currentLine > 1
|
||||
let bottom = currentLine
|
||||
|
||||
"the right delimiter is on the same line as the last sexyComMarker
|
||||
|
Loading…
x
Reference in New Issue
Block a user