mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-09 18:23:48 -05:00
bugfix: stopped infine loop when checking for sexy comment on first/last line of file
This commit is contained in:
@@ -2325,12 +2325,12 @@ function s:FindBoundingLinesOfSexyCom(lineNum)
|
|||||||
let theLine = getline(currentLine)
|
let theLine = getline(currentLine)
|
||||||
|
|
||||||
"check if the current line is the top of the sexy comment
|
"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 top = currentLine
|
||||||
let currentLine = a:lineNum
|
let currentLine = a:lineNum
|
||||||
|
|
||||||
"check if the current line is the bottom of the sexy comment
|
"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
|
let bottom = currentLine
|
||||||
|
|
||||||
"the right delimiter is on the same line as the last sexyComMarker
|
"the right delimiter is on the same line as the last sexyComMarker
|
||||||
|
|||||||
Reference in New Issue
Block a user