From 3eb5a0fcdefb2e7a05cf10cc4878106dc29c4bfc Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Mon, 28 Apr 2008 22:40:51 +1200 Subject: [PATCH] bugfix: fixed another infinite loop when detecting sexy comments --- plugin/NERD_commenter.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 19db7be..0f13b98 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -2325,7 +2325,7 @@ 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 && currentLine < s:NumLinesInBuf() + if currentLine <= a:lineNum && theLine =~ '^[ \t]*' . left && theLine !~ '.*' . right && currentLine < s:NumLinesInBuf() let top = currentLine let currentLine = a:lineNum