aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMarko Njezic <devnull@localhost>2012-02-04 12:29:23 +0100
committerMarko Njezic <devnull@localhost>2012-02-04 12:29:23 +0100
commitf8d4f6ac27b894c75b894ae066257de360ae2ea3 (patch)
tree655f3ef01c46c17eb8e94ca1b8236b5f3feb7fa5 /src
parent8c79f346f5a37328aba0417d37020c2f08613dc4 (diff)
downloadscintilla-mirror-f8d4f6ac27b894c75b894ae066257de360ae2ea3.tar.gz
Make priority wrap actually process all displayed document lines. Bug #3484179.
Diffstat (limited to 'src')
-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)) {