Window: segregate builtins highlighters from the others

This commit is contained in:
Maxime Coste 2013-03-01 14:29:59 +01:00
parent 6318f2268f
commit 6b812d9f6c
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -60,6 +60,7 @@ private:
DisplayBuffer m_display_buffer;
HighlighterGroup m_highlighters;
HighlighterGroup m_builtin_highlighters;
HookManager m_hooks;
OptionManager m_options;