summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-06-07 13:29:44 +0000
committerMaxime Coste <frrrwww@gmail.com>2012-06-07 13:29:44 +0000
commit9bcfda3226413345f3862541fb498bb5d4c62156 (patch)
tree22b9ca401ebdd2d51354992d35f218f8030f4c03 /src/buffer.cc
parent6a416abae2c93ed5699164bea23da4a52e1bcafc (diff)
HookManager are now hierarchical from window to buffer to global
window hooks also executes buffer hook which also execute global hooks
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc6
1 files changed, 3 insertions, 3 deletions
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 <algorithm>
@@ -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()