diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-10-28 11:00:51 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-10-28 13:43:04 +0800 |
| commit | d49555fc7568cff0db385d019a68cfdb0f28f8b0 (patch) | |
| tree | 54c852fe6bba4236baf632111341312547ed77f8 /src/highlighter_group.cc | |
| parent | 9a449a33446f1c52bb02b4bea13bbc86d5742f2d (diff) | |
Move highlighters into Scopes
That means we can now have highlighters active at global, buffer, and
window scope. The add-highlighter and remove-highlighter syntax changed
to take the parent path (scope/group/...) as a mandatory argument,
superseeding the previous -group switch.
Diffstat (limited to 'src/highlighter_group.cc')
| -rw-r--r-- | src/highlighter_group.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/highlighter_group.cc b/src/highlighter_group.cc index 33723d66..39130159 100644 --- a/src/highlighter_group.cc +++ b/src/highlighter_group.cc @@ -69,4 +69,19 @@ Completions HighlighterGroup::complete_child(StringView path, ByteCount cursor_p return { 0, 0, std::move(candidates) }; } +void Highlighters::do_highlight(const Context& context, HighlightPass pass, + DisplayBuffer& display_buffer, BufferRange range) +{ + if (m_parent) + m_parent->do_highlight(context, pass, display_buffer, range); + HighlighterGroup::do_highlight(context, pass, display_buffer, range); +} + +void Highlighters::do_compute_display_setup(const Context& context, HighlightPass pass, DisplaySetup& setup) +{ + if (m_parent) + m_parent->do_compute_display_setup(context, pass, setup); + HighlighterGroup::do_compute_display_setup(context, pass, setup); +} + } |
