From f1efaeac8c31646f3ead0212c61428d8626db1dc Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 4 Sep 2008 13:05:55 +0000 Subject: Bug #2087470 fix. Avoid very long searches for a non-blank line to determine indentation guides. --- src/Editor.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 1c08b7cc9..ffc2dee22 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2566,7 +2566,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis // Find the most recent line with some text int lineLastWithText = line; - while (lineLastWithText > 0 && pdoc->IsWhiteLine(lineLastWithText)) { + while (lineLastWithText > Platform::Maximum(line-20, 0) && pdoc->IsWhiteLine(lineLastWithText)) { lineLastWithText--; } if (lineLastWithText < line) { @@ -2588,7 +2588,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis } int lineNextWithText = line; - while (lineNextWithText < pdoc->LinesTotal() && pdoc->IsWhiteLine(lineNextWithText)) { + while (lineNextWithText < Platform::Minimum(line+20, pdoc->LinesTotal()) && pdoc->IsWhiteLine(lineNextWithText)) { lineNextWithText++; } if (lineNextWithText > line) { -- cgit v1.2.3