aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2008-08-10 11:32:44 +0000
committernyamatongwe <devnull@localhost>2008-08-10 11:32:44 +0000
commite5cf36fcacaf92b4a1ef598cfd0e1dda6d39088a (patch)
tree689ff7456c4e59257ce93114cb41b4854ce30bb3 /src
parentd81d1ab0ff6f822a839166558713f4b3f91a4879 (diff)
downloadscintilla-mirror-e5cf36fcacaf92b4a1ef598cfd0e1dda6d39088a.tar.gz
Changed ClearDocumentStyle to only act on decorators that exist.
Diffstat (limited to 'src')
-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);