From a0b43abe46dca3ffd7fa1c6f75da97b3d614dce0 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 16 Oct 2003 13:12:36 +0000 Subject: When multiple lines added, wrap all the added lines not just the top 2. --- src/Editor.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index c8efe0a6e..0a54ba2aa 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1410,8 +1410,9 @@ void Editor::NeedWrapping(int docLineStartWrapping, int docLineEndWrapping) { docLastLineToWrap = pdoc->LinesTotal(); } // Wrap lines during idle. - if (docLastLineToWrap != docLineLastWrapped) + if (docLastLineToWrap != docLineLastWrapped) { SetIdle(true); + } } // Check if wrapping needed and perform any needed wrapping. @@ -3408,7 +3409,7 @@ void Editor::CheckModificationForWrap(DocModification mh) { llc.Invalidate(LineLayout::llCheckTextAndStyle); if (wrapState != eWrapNone) { int lineDoc = pdoc->LineFromPosition(mh.position); - if (mh.linesAdded == 0) { + if (mh.linesAdded <= 0) { AutoSurface surface(this); AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc)); if (surface && ll) { @@ -3417,11 +3418,9 @@ void Editor::CheckModificationForWrap(DocModification mh) { NeedWrapping(lineDoc - 1, lineDoc + 1); Redraw(); } - } else { - NeedWrapping(lineDoc, lineDoc + 1); } } else { - NeedWrapping(lineDoc, lineDoc + 1); + NeedWrapping(lineDoc, lineDoc + 1 + mh.linesAdded); } } } -- cgit v1.2.3