aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2008-08-10 11:32:44 +0000
committernyamatongwe <unknown>2008-08-10 11:32:44 +0000
commit3c0e211cd302c89ed24149e37abe9fed36992f22 (patch)
tree689ff7456c4e59257ce93114cb41b4854ce30bb3
parent3be9c420feeffc6d580f50776c58d581fc7234e7 (diff)
downloadscintilla-mirror-3c0e211cd302c89ed24149e37abe9fed36992f22.tar.gz
Changed ClearDocumentStyle to only act on decorators that exist.
-rw-r--r--src/Editor.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index e28275917..1c08b7cc9 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3493,9 +3493,15 @@ void Editor::ClearAll() {
}
void Editor::ClearDocumentStyle() {
- for (int i=0; i < INDIC_CONTAINER; i++) {
- pdoc->decorations.SetCurrentIndicator(i);
- pdoc->DecorationFillRange(0, 0, pdoc->Length());
+ Decoration *deco = pdoc->decorations.root;
+ while (deco) {
+ // Save next in case deco deleted
+ Decoration *decoNext = deco->next;
+ if (deco->indicator < INDIC_CONTAINER) {
+ pdoc->decorations.SetCurrentIndicator(deco->indicator);
+ pdoc->DecorationFillRange(0, 0, pdoc->Length());
+ }
+ deco = decoNext;
}
pdoc->StartStyling(0, '\377');
pdoc->SetStyleFor(pdoc->Length(), 0);