aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-10-16 13:12:36 +0000
committernyamatongwe <devnull@localhost>2003-10-16 13:12:36 +0000
commit4a940a4aadb96ff947543c7e579add09652f5ffa (patch)
tree794989d63cbf02dda84ee5866b27c5563992c362
parente5bc157729ba7d4ea645f00eefb585bc09350581 (diff)
downloadscintilla-mirror-4a940a4aadb96ff947543c7e579add09652f5ffa.tar.gz
When multiple lines added, wrap all the added lines not just the top 2.
-rw-r--r--src/Editor.cxx9
1 files changed, 4 insertions, 5 deletions
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);
}
}
}