From 6b812d9f6c108743e064ac15e9e3f70d7b45768a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 1 Mar 2013 14:29:59 +0100 Subject: [PATCH] Window: segregate builtins highlighters from the others --- src/window.cc | 8 +++++--- src/window.hh | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/window.cc b/src/window.cc index 6b7f61b9..ea2c8d36 100644 --- a/src/window.cc +++ b/src/window.cc @@ -22,9 +22,9 @@ Window::Window(Buffer& buffer) m_hooks.run_hook("WinCreate", buffer.name(), hook_context); m_options.register_watcher(*this); - m_highlighters.append(registry["expand_tabs"](*this, {})); - m_highlighters.append(registry["expand_unprintable"](*this, {})); - m_highlighters.append(registry["highlight_selections"](*this, {})); + m_builtin_highlighters.append(registry["expand_tabs"](*this, {})); + m_builtin_highlighters.append(registry["expand_unprintable"](*this, {})); + m_builtin_highlighters.append(registry["highlight_selections"](*this, {})); for (auto& option : m_options.flatten_options()) on_option_changed(option.first, option.second); @@ -65,6 +65,7 @@ void Window::update_display_buffer() m_display_buffer.compute_range(); m_highlighters(m_display_buffer); + m_builtin_highlighters(m_display_buffer); m_display_buffer.optimize(); m_timestamp = buffer().timestamp(); @@ -108,6 +109,7 @@ void Window::scroll_to_keep_cursor_visible_ifn() display_buffer.compute_range(); m_highlighters(display_buffer); + m_builtin_highlighters(display_buffer); // now we can compute where the cursor is in display columns // (this is only valid if highlighting one line and multiple lines put diff --git a/src/window.hh b/src/window.hh index 3e3c187f..9c62356f 100644 --- a/src/window.hh +++ b/src/window.hh @@ -60,6 +60,7 @@ private: DisplayBuffer m_display_buffer; HighlighterGroup m_highlighters; + HighlighterGroup m_builtin_highlighters; HookManager m_hooks; OptionManager m_options;