diff options
| author | Neil <nyamatongwe@gmail.com> | 2017-05-10 14:15:16 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2017-05-10 14:15:16 +1000 |
| commit | 789644c36be4220ae0920ec3bc60115a3a05b160 (patch) | |
| tree | 8a6bcb68122a37b529665056cc9b346e50b192f6 /src/Editor.cxx | |
| parent | 91c4a9ff07821dce93dab3ffd77df081893b723d (diff) | |
| download | scintilla-mirror-789644c36be4220ae0920ec3bc60115a3a05b160.tar.gz | |
Simplify DecorationList and its clients by using a vector instead of an
intrusive linked list. Restrict clients to a read-only view.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9344b7d94..77443d52f 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2097,16 +2097,7 @@ void Editor::ClearAll() { } void Editor::ClearDocumentStyle() { - Decoration *deco = pdoc->decorations.Root(); - while (deco) { - // Save next in case deco deleted - Decoration *decoNext = deco->Next(); - if (deco->Indicator() < INDIC_CONTAINER) { - pdoc->DecorationSetCurrentIndicator(deco->Indicator()); - pdoc->DecorationFillRange(0, 0, pdoc->Length()); - } - deco = decoNext; - } + pdoc->decorations.DeleteLexerDecorations(); pdoc->StartStyling(0, '\377'); pdoc->SetStyleFor(pdoc->Length(), 0); cs.ShowAll(); @@ -4651,7 +4642,7 @@ void Editor::SetHoverIndicatorPosition(Sci::Position position) { if (!vs.indicatorsDynamic) return; if (position != INVALID_POSITION) { - for (Decoration *deco = pdoc->decorations.Root(); deco; deco = deco->Next()) { + for (const Decoration *deco : pdoc->decorations.View()) { if (vs.indicators[deco->Indicator()].IsDynamic()) { if (pdoc->decorations.ValueAt(deco->Indicator(), position)) { hoverIndicatorPos = position; |
