From b3c49124044a20bc90ae151a91015c42d3afc4f4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 24 Sep 2012 13:56:39 +0200 Subject: [PATCH] Use context.editor() instead of context.window() when a window is not needed --- src/commands.cc | 12 ++++++------ src/main.cc | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index 9f8e6d58..1303f4fd 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -471,10 +471,10 @@ void add_filter(const CommandParameters& params, Context& context) for (++begin; begin != parser.end(); ++begin) filter_params.push_back(*begin); - Window& window = context.window(); + Editor& editor = context.editor(); FilterGroup& group = parser.has_option("group") ? - window.filters().get_group(parser.option_value("group")) - : window.filters(); + editor.filters().get_group(parser.option_value("group")) + : editor.filters(); registry.add_filter_to_group(group, name, filter_params); } @@ -485,10 +485,10 @@ void rm_filter(const CommandParameters& params, Context& context) if (parser.positional_count() != 1) throw wrong_argument_count(); - Window& window = context.window(); + Editor& editor = context.editor(); FilterGroup& group = parser.has_option("group") ? - window.filters().get_group(parser.option_value("group")) - : window.filters(); + editor.filters().get_group(parser.option_value("group")) + : editor.filters(); group.remove(parser[0]); } diff --git a/src/main.cc b/src/main.cc index 929323c3..4534165e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -455,7 +455,7 @@ int main(int argc, char* argv[]) { return context.buffer().name(); }); shell_manager.register_env_var("selection", [](const String& name, const Context& context) - { return context.window().selections_content().back(); }); + { return context.editor().selections_content().back(); }); shell_manager.register_env_var("runtime", [](const String& name, const Context& context) { return runtime_directory(); });