commands: code cleanup
This commit is contained in:
parent
759319ca44
commit
808e79a53e
|
@ -270,7 +270,7 @@ void write_buffer(const CommandParameters& params, Context& context)
|
||||||
if (params.size() > 1)
|
if (params.size() > 1)
|
||||||
throw wrong_argument_count();
|
throw wrong_argument_count();
|
||||||
|
|
||||||
Buffer& buffer = context.window().buffer();
|
Buffer& buffer = context.buffer();
|
||||||
|
|
||||||
if (params.empty() and buffer.type() == Buffer::Type::Scratch)
|
if (params.empty() and buffer.type() == Buffer::Type::Scratch)
|
||||||
throw runtime_error("cannot write scratch buffer without a filename");
|
throw runtime_error("cannot write scratch buffer without a filename");
|
||||||
|
@ -401,7 +401,7 @@ void rm_highlighter(const CommandParameters& params, Context& context)
|
||||||
window.highlighters().get_group(parser.option_value("group"))
|
window.highlighters().get_group(parser.option_value("group"))
|
||||||
: window.highlighters();
|
: window.highlighters();
|
||||||
|
|
||||||
group.remove(*parser.begin());
|
group.remove(parser[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_filter(const CommandParameters& params, Context& context)
|
void add_filter(const CommandParameters& params, Context& context)
|
||||||
|
@ -437,7 +437,7 @@ void rm_filter(const CommandParameters& params, Context& context)
|
||||||
window.filters().get_group(parser.option_value("group"))
|
window.filters().get_group(parser.option_value("group"))
|
||||||
: window.filters();
|
: window.filters();
|
||||||
|
|
||||||
group.remove(*parser.begin());
|
group.remove(parser[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_hook(const CommandParameters& params, Context& context)
|
void add_hook(const CommandParameters& params, Context& context)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user