From 665d3fa196f4df905ebd682965adf78d80eaf8a8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 13 Jun 2018 07:11:03 +1000 Subject: [PATCH] Fix edit -fifo without -scroll when the buffer is already opened Scrolling was taking place in that case even though it was not desired. --- src/commands.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index 213926f7..b196f847 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -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() ?