From c38f244c06a9024d813c74567e61b1892d5b4b64 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 23 Jan 2012 13:57:24 +0000 Subject: [PATCH] Window have it's own hooks manager --- src/window.cc | 2 +- src/window.hh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/window.cc b/src/window.cc index 583be51e..f123f6b5 100644 --- a/src/window.cc +++ b/src/window.cc @@ -466,7 +466,7 @@ IncrementalInserter::~IncrementalInserter() m_window.push_selections(); try { - GlobalHooksManager::instance().run_hook("WinInsertEnd", "", Context(m_window)); + m_window.hooks_manager().run_hook("InsertEnd", "", Context(m_window)); } catch (runtime_error& e) {} m_window.pop_selections(); diff --git a/src/window.hh b/src/window.hh index c75dc2f2..05fbc159 100644 --- a/src/window.hh +++ b/src/window.hh @@ -11,6 +11,7 @@ #include "highlighter_group.hh" #include "filter.hh" #include "idvaluemap.hh" +#include "hooks_manager.hh" namespace Kakoune { @@ -114,6 +115,8 @@ public: void push_selections(); void pop_selections(); + HooksManager& hooks_manager() { return m_hooks_manager; } + private: friend class Buffer; @@ -140,6 +143,8 @@ private: HighlighterGroup m_highlighters; idvaluemap m_filters; + + HooksManager m_hooks_manager; }; class IncrementalInserter