aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarko Njezic <unknown>2012-02-04 12:29:23 +0100
committerMarko Njezic <unknown>2012-02-04 12:29:23 +0100
commit28084d27ba2f6248dc5cb7618d63be86dea16581 (patch)
tree51b4ba43ea11279436388fd29fd7c21d5e197493
parent7a44bd031fcfe2b9186e13a2597d3455e89ca5f3 (diff)
downloadscintilla-mirror-28084d27ba2f6248dc5cb7618d63be86dea16581.tar.gz
Make priority wrap actually process all displayed document lines. Bug #3484179.
-rw-r--r--src/Editor.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 58401a330..5ed364090 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1465,6 +1465,12 @@ bool Editor::WrapOneLine(Surface *surface, int lineToWrap) {
bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {
// If there are any pending wraps, do them during idle if possible.
int linesInOneCall = LinesOnScreen() + 100;
+ if (priorityWrapLineStart >= 0) {
+ // Using DocFromDisplay() here may result in chicken and egg problem in certain corner cases,
+ // which will hopefully be handled by added 100 lines. If some lines are still missed, idle wrapping will catch on.
+ int docLinesInOneCall = cs.DocFromDisplay(topLine + LinesOnScreen() + 100) - cs.DocFromDisplay(topLine);
+ linesInOneCall = Platform::Maximum(linesInOneCall, docLinesInOneCall);
+ }
if (wrapState != eWrapNone) {
if (wrapStart < wrapEnd) {
if (!SetIdle(true)) {