diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 12 |
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); |