aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx8
-rw-r--r--src/Editor.h1
2 files changed, 7 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);
diff --git a/src/Editor.h b/src/Editor.h
index f1a500b74..cd5695c09 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -226,6 +226,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
enum { notPainting, painting, paintAbandoned } paintState;
PRectangle rcPaint;
bool paintingAllText;
+ bool willRedrawAll;
StyleNeeded styleNeeded;
int modEventMask;