diff options
author | nyamatongwe <unknown> | 2010-07-07 03:23:11 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-07-07 03:23:11 +0000 |
commit | 0b6e7242716a538874d39d2e05d02182d456de88 (patch) | |
tree | bef1c6a09a5d08fabab930f9347cbc37eb1c1e68 | |
parent | bfbb9c2448820b005e463fc30a684b724bda5ec5 (diff) | |
download | scintilla-mirror-0b6e7242716a538874d39d2e05d02182d456de88.tar.gz |
Redraw when annotations change.
DeleteAllMarks will only cause a modification notification when a mark was actually deleted.
-rw-r--r-- | src/Document.cxx | 14 | ||||
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | src/PerLine.cxx | 7 | ||||
-rw-r--r-- | src/PerLine.h | 2 |
4 files changed, 19 insertions, 6 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index bc3ae0979..08d35a893 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -192,12 +192,16 @@ void Document::DeleteMarkFromHandle(int markerHandle) { } void Document::DeleteAllMarks(int markerNum) { + bool someChanges = false; for (int line = 0; line < LinesTotal(); line++) { - static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMark(line, markerNum, true); + if (static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMark(line, markerNum, true)) + someChanges = true; + } + if (someChanges) { + DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0); + mh.line = -1; + NotifyModified(mh); } - DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0); - mh.line = -1; - NotifyModified(mh); } int Document::LineFromHandle(int markerHandle) { @@ -1430,6 +1434,8 @@ void Document::AnnotationSetText(int line, const char *text) { void Document::AnnotationSetStyle(int line, int style) { static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyle(line, style); + DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line); + NotifyModified(mh); } void Document::AnnotationSetStyles(int line, const unsigned char *styles) { diff --git a/src/Editor.cxx b/src/Editor.cxx index 9761c10c9..ecac75118 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4354,6 +4354,7 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) { int lineDoc = pdoc->LineFromPosition(mh.position); if (vs.annotationVisible) { cs.SetHeight(lineDoc, cs.GetHeight(lineDoc) + mh.annotationLinesAdded); + Redraw(); } } CheckModificationForWrap(mh); @@ -6374,6 +6375,7 @@ void Editor::SetAnnotationVisible(int visible) { } } } + Redraw(); } } diff --git a/src/PerLine.cxx b/src/PerLine.cxx index a19c117bc..21d02af72 100644 --- a/src/PerLine.cxx +++ b/src/PerLine.cxx @@ -202,15 +202,19 @@ int LineMarkers::AddMark(int line, int markerNum, int lines) { return handleCurrent; } -void LineMarkers::DeleteMark(int line, int markerNum, bool all) { +bool LineMarkers::DeleteMark(int line, int markerNum, bool all) { + bool someChanges = false; if (markers.Length() && (line >= 0) && (line < markers.Length()) && markers[line]) { if (markerNum == -1) { + someChanges = true; delete markers[line]; markers[line] = NULL; } else { bool performedDeletion = markers[line]->RemoveNumber(markerNum); + someChanges = someChanges || performedDeletion; while (all && performedDeletion) { performedDeletion = markers[line]->RemoveNumber(markerNum); + someChanges = someChanges || performedDeletion; } if (markers[line]->Length() == 0) { delete markers[line]; @@ -218,6 +222,7 @@ void LineMarkers::DeleteMark(int line, int markerNum, bool all) { } } } + return someChanges; } void LineMarkers::DeleteMarkFromHandle(int markerHandle) { diff --git a/src/PerLine.h b/src/PerLine.h index 8f1566bd3..df4728632 100644 --- a/src/PerLine.h +++ b/src/PerLine.h @@ -56,7 +56,7 @@ public: int MarkValue(int line); int AddMark(int line, int marker, int lines); void MergeMarkers(int pos); - void DeleteMark(int line, int markerNum, bool all); + bool DeleteMark(int line, int markerNum, bool all); void DeleteMarkFromHandle(int markerHandle); int LineFromHandle(int markerHandle); }; |