From b6d21514e4217ee811682338e4ccf4fab5477cd6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 12 Apr 2013 19:11:28 +0200 Subject: [PATCH] BufOpen hook is only called for file buffers --- src/buffer.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index a7811c9a..1d017c40 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -39,10 +39,13 @@ Buffer::Buffer(String name, Flags flags, std::vector lines) Editor editor_for_hooks(*this); Context context(editor_for_hooks); - if (flags & Flags::File and flags & Flags::New) - m_hooks.run_hook("BufNew", m_name, context); - else - m_hooks.run_hook("BufOpen", m_name, context); + if (flags & Flags::File) + { + if (flags & Flags::New) + m_hooks.run_hook("BufNew", m_name, context); + else + m_hooks.run_hook("BufOpen", m_name, context); + } m_hooks.run_hook("BufCreate", m_name, context);