From 12ce590f186e025890011fec185489eb5cccf3dd Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 14 Jan 2013 19:26:44 +0100 Subject: [PATCH] Context: add a hooks method similar to the options one --- src/context.hh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/context.hh b/src/context.hh index 079847f2..176df273 100644 --- a/src/context.hh +++ b/src/context.hh @@ -88,6 +88,15 @@ struct Context return GlobalOptions::instance(); } + HookManager& hooks() const + { + if (has_window()) + return window().hooks(); + if (has_buffer()) + return buffer().hooks(); + return GlobalHooks::instance(); + } + void print_status(const String& status) const { if (has_ui())