diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index a1c88cc20..de0afdf49 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -193,6 +193,7 @@ Editor::Editor() { theEdge = 0; paintState = notPainting; + willRedrawAll = false; modEventMask = SC_MODEVENTMASKALL; @@ -984,6 +985,8 @@ void Editor::ScrollTo(int line, bool moveThumb) { // Try to optimise small scrolls #ifndef UNDER_CE int linesToMove = topLine - topLineNew; + bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting); + willRedrawAll = !performBlit; #endif SetTopLine(topLineNew); // Optimize by styling the view as this will invalidate any needed area @@ -991,11 +994,12 @@ void Editor::ScrollTo(int line, bool moveThumb) { StyleToPositionInView(PositionAfterArea(GetClientRectangle())); #ifndef UNDER_CE // Perform redraw rather than scroll if many lines would be redrawn anyway. - if ((abs(linesToMove) <= 10) && (paintState == notPainting)) { + if (performBlit) { ScrollText(linesToMove); } else { Redraw(); } + willRedrawAll = false; #else Redraw(); #endif @@ -4649,7 +4653,7 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) { } if ((mh.modificationType & SC_MOD_CHANGEMARKER) || (mh.modificationType & SC_MOD_CHANGEMARGIN)) { - if ((paintState == notPainting) || !PaintContainsMargin()) { + if ((!willRedrawAll) && ((paintState == notPainting) || !PaintContainsMargin())) { if (mh.modificationType & SC_MOD_CHANGEFOLD) { // Fold changes can affect the drawing of following lines so redraw whole margin RedrawSelMargin(mh.line-1, true); |