diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Document.cxx | 4 | ||||
-rw-r--r-- | src/Document.h | 1 | ||||
-rw-r--r-- | src/Editor.cxx | 21 | ||||
-rw-r--r-- | src/Editor.h | 1 | ||||
-rw-r--r-- | src/PerLine.cxx | 11 | ||||
-rw-r--r-- | src/PerLine.h | 1 |
6 files changed, 29 insertions, 10 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 5c05aa5e0..4a7546cf1 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -185,6 +185,10 @@ int Document::GetMark(int line) { return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkValue(line); } +int Document::MarkerNext(int lineStart, int mask) const { + return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkerNext(lineStart, mask); +} + int Document::AddMark(int line, int markerNum) { if (line >= 0 && line <= LinesTotal()) { int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])-> diff --git a/src/Document.h b/src/Document.h index 00d23a45d..15aecbfe4 100644 --- a/src/Document.h +++ b/src/Document.h @@ -323,6 +323,7 @@ public: cb.GetStyleRange(buffer, position, lengthRetrieve); } int GetMark(int line); + int MarkerNext(int lineStart, int mask) const; int AddMark(int line, int markerNum); void AddMarkSet(int line, int valueSet); void DeleteMark(int line, int markerNum); 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(); diff --git a/src/Editor.h b/src/Editor.h index 7a30fdf3f..06b905961 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -227,6 +227,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; diff --git a/src/PerLine.cxx b/src/PerLine.cxx index 7d961a886..c31d4ea9b 100644 --- a/src/PerLine.cxx +++ b/src/PerLine.cxx @@ -182,6 +182,17 @@ int LineMarkers::MarkValue(int line) { return 0; } +int LineMarkers::MarkerNext(int lineStart, int mask) const { + int length = markers.Length(); + for (int iLine = lineStart; iLine < length; iLine++) { + MarkerHandleSet *onLine = markers[iLine]; + if (onLine && ((onLine->MarkValue() & mask) != 0)) + //if ((pdoc->GetMark(iLine) & lParam) != 0) + return iLine; + } + return -1; +} + int LineMarkers::AddMark(int line, int markerNum, int lines) { handleCurrent++; if (!markers.Length()) { diff --git a/src/PerLine.h b/src/PerLine.h index df4728632..b43c52bb8 100644 --- a/src/PerLine.h +++ b/src/PerLine.h @@ -54,6 +54,7 @@ public: virtual void RemoveLine(int line); int MarkValue(int line); + int MarkerNext(int lineStart, int mask) const; int AddMark(int line, int marker, int lines); void MergeMarkers(int pos); bool DeleteMark(int line, int markerNum, bool all); |