From bfbb9c2448820b005e463fc30a684b724bda5ec5 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 26 Jun 2010 11:41:48 +0000 Subject: Improve responsiveness in wrap mode by only lexing text that is about to be wrapped rather than lexing the whole document at once. --- src/Editor.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 8a0ad64c4..9761c10c9 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1406,8 +1406,6 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) { rcTextArea.left = vs.fixedColumnWidth; rcTextArea.right -= vs.rightMarginWidth; wrapWidth = rcTextArea.Width(); - // Ensure all of the document is styled. - pdoc->EnsureStyledTo(pdoc->Length()); RefreshStyleData(); AutoSurface surface(this); if (surface) { @@ -1428,6 +1426,9 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) { lastLineToWrap = wrapEnd; } // else do a fullWrap. + // Ensure all lines being wrapped are styled. + pdoc->EnsureStyledTo(pdoc->LineEnd(lastLineToWrap)); + // Platform::DebugPrintf("Wraplines: full = %d, priorityStart = %d (wrapping: %d to %d)\n", fullWrap, priorityWrapLineStart, lineToWrap, lastLineToWrap); // Platform::DebugPrintf("Pending wraps: %d to %d\n", wrapStart, wrapEnd); while (lineToWrap < lastLineToWrap) { -- cgit v1.2.3