diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9e84132f2..507ae60a1 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -194,6 +194,7 @@ Editor::Editor() { theEdge = 0; paintState = notPainting; + willRedrawAll = false; modEventMask = SC_MODEVENTMASKALL; @@ -1013,6 +1014,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 @@ -1020,11 +1023,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 @@ -4680,7 +4684,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); @@ -8074,14 +8078,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_MARKERGET: return pdoc->GetMark(wParam); - case SCI_MARKERNEXT: { - int lt = pdoc->LinesTotal(); - for (int iLine = wParam; iLine < lt; iLine++) { - if ((pdoc->GetMark(iLine) & lParam) != 0) - return iLine; - } - } - return -1; + case SCI_MARKERNEXT: + return pdoc->MarkerNext(wParam, lParam); case SCI_MARKERPREVIOUS: { for (int iLine = wParam; iLine >= 0; iLine--) { @@ -8304,6 +8302,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_GETLINEVISIBLE: return cs.GetVisible(wParam); + case SCI_GETALLLINESVISIBLE: + return cs.HiddenLines() ? 0 : 1; + case SCI_SETFOLDEXPANDED: if (cs.SetExpanded(wParam, lParam != 0)) { RedrawSelMargin(); |