From 1a20e26cc44adbd8ad18bf6af2b30335feeb88b5 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 2 Oct 2017 21:07:16 +0800 Subject: [PATCH] Allow itersel with draft context to change the buffer That way we can cater to the use case of executing some keys for `:grep` matches with `exec -itersel -draft :grep-jump...` --- src/commands.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index e96f8deb..15a98e8c 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1639,11 +1639,11 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func) func(parser, c); - if (&sels.buffer() != &c.buffer()) - throw runtime_error("the buffer has changed while iterating on selections"); - if (not draft) { + if (&sels.buffer() != &c.buffer()) + throw runtime_error("the buffer has changed while iterating on selections"); + update_selections(new_sels, main, c.buffer(), timestamp); timestamp = c.buffer().timestamp(); for (auto& sel : c.selections())