From 9bcfda3226413345f3862541fb498bb5d4c62156 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 7 Jun 2012 13:29:44 +0000 Subject: HookManager are now hierarchical from window to buffer to global window hooks also executes buffer hook which also execute global hooks --- src/buffer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buffer.cc') diff --git a/src/buffer.cc b/src/buffer.cc index 7f3f8000..a1f943e8 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -4,7 +4,6 @@ #include "window.hh" #include "assert.hh" #include "utils.hh" -#include "hook_manager.hh" #include "context.hh" #include @@ -27,6 +26,7 @@ Buffer::Buffer(const String& name, Type type, : m_name(name), m_type(type), m_history(1), m_history_cursor(m_history.begin()), m_last_save_undo_index(0), + m_hook_manager(GlobalHookManager::instance()), m_option_manager(GlobalOptionManager::instance()) { BufferManager::instance().register_buffer(this); @@ -34,9 +34,9 @@ Buffer::Buffer(const String& name, Type type, apply_modification(Modification::make_insert(begin(), initial_content)); if (type == Type::NewFile) - GlobalHookManager::instance().run_hook("BufCreate", name, Context(*this)); + m_hook_manager.run_hook("BufCreate", name, Context(*this)); else if (type == Type::File) - GlobalHookManager::instance().run_hook("BufOpen", name, Context(*this)); + m_hook_manager.run_hook("BufOpen", name, Context(*this)); } Buffer::~Buffer() -- cgit v1.2.3