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<ret>...`
This commit is contained in:
Maxime Coste 2017-10-02 21:07:16 +08:00
parent 30ab437777
commit 1a20e26cc4

View File

@ -1639,11 +1639,11 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func)
func(parser, c); func(parser, c);
if (&sels.buffer() != &c.buffer())
throw runtime_error("the buffer has changed while iterating on selections");
if (not draft) 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); update_selections(new_sels, main, c.buffer(), timestamp);
timestamp = c.buffer().timestamp(); timestamp = c.buffer().timestamp();
for (auto& sel : c.selections()) for (auto& sel : c.selections())