Fix edit -fifo without -scroll when the buffer is already opened

Scrolling was taking place in that case even though it was not
desired.
This commit is contained in:
Maxime Coste 2018-06-13 07:11:03 +10:00
parent ee19497d37
commit 665d3fa196

View File

@ -266,7 +266,9 @@ void edit(const ParametersParser& parser, Context& context, const ShellContext&)
if (buffer != current_buffer)
context.change_buffer(*buffer);
if (param_count > 1 and not parser[1].empty())
if (parser.get_switch("fifo") and not parser.get_switch("scroll"))
context.selections_write_only() = { *buffer, Selection{} };
else if (param_count > 1 and not parser[1].empty())
{
int line = std::max(0, str_to_int(parser[1]) - 1);
int column = param_count > 2 and not parser[2].empty() ?