From 77ac777526a6a05c2d2027e30c0bbcf9720ad5b7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 25 Oct 2013 00:00:44 +0100 Subject: [PATCH] use prefix matching for hook scope --- src/commands.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index 26a3b75f..eeb33e1a 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -318,11 +318,11 @@ void rm_filter(CommandParameters params, Context& context) static HookManager& get_hook_manager(const String& scope, Context& context) { - if (scope == "global") + if (prefix_match("global", scope)) return GlobalHooks::instance(); - else if (scope == "buffer") + else if (prefix_match("buffer", scope)) return context.buffer().hooks(); - else if (scope == "window") + else if (prefix_match("window", scope)) return context.window().hooks(); throw runtime_error("error: no such hook container " + scope); }