Use context.editor() instead of context.window() when a window is not needed

This commit is contained in:
Maxime Coste 2012-09-24 13:56:39 +02:00
parent e86e3bda4d
commit b3c4912404
2 changed files with 7 additions and 7 deletions

View File

@ -471,10 +471,10 @@ void add_filter(const CommandParameters& params, Context& context)
for (++begin; begin != parser.end(); ++begin) for (++begin; begin != parser.end(); ++begin)
filter_params.push_back(*begin); filter_params.push_back(*begin);
Window& window = context.window(); Editor& editor = context.editor();
FilterGroup& group = parser.has_option("group") ? FilterGroup& group = parser.has_option("group") ?
window.filters().get_group(parser.option_value("group")) editor.filters().get_group(parser.option_value("group"))
: window.filters(); : editor.filters();
registry.add_filter_to_group(group, name, filter_params); 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) if (parser.positional_count() != 1)
throw wrong_argument_count(); throw wrong_argument_count();
Window& window = context.window(); Editor& editor = context.editor();
FilterGroup& group = parser.has_option("group") ? FilterGroup& group = parser.has_option("group") ?
window.filters().get_group(parser.option_value("group")) editor.filters().get_group(parser.option_value("group"))
: window.filters(); : editor.filters();
group.remove(parser[0]); group.remove(parser[0]);
} }

View File

@ -455,7 +455,7 @@ int main(int argc, char* argv[])
{ return context.buffer().name(); }); { return context.buffer().name(); });
shell_manager.register_env_var("selection", shell_manager.register_env_var("selection",
[](const String& name, const Context& context) [](const String& name, const Context& context)
{ return context.window().selections_content().back(); }); { return context.editor().selections_content().back(); });
shell_manager.register_env_var("runtime", shell_manager.register_env_var("runtime",
[](const String& name, const Context& context) [](const String& name, const Context& context)
{ return runtime_directory(); }); { return runtime_directory(); });