Code style tweak in insert_output
This commit is contained in:
parent
32157a5809
commit
874717885a
|
@ -638,22 +638,15 @@ void insert_output(Context& context, NormalParams)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ScopedEdition edition(context);
|
ScopedEdition edition(context);
|
||||||
Buffer& buffer = context.buffer();
|
|
||||||
auto& shell_manager = ShellManager::instance();
|
|
||||||
auto& selections = context.selections();
|
auto& selections = context.selections();
|
||||||
Vector<String> ins;
|
|
||||||
const size_t old_main = selections.main_index();
|
const size_t old_main = selections.main_index();
|
||||||
|
|
||||||
for (size_t i = 0; i < selections.size(); i++)
|
auto ins = selections | transform([&, i=0](auto& sel) mutable {
|
||||||
{
|
selections.set_main_index(i++);
|
||||||
selections.set_main_index(i);
|
return ShellManager::instance().eval(
|
||||||
|
cmdline, context, content(context.buffer(), sel),
|
||||||
auto& sel = selections.main();
|
ShellManager::Flags::WaitForStdout).first;
|
||||||
auto str = shell_manager.eval(cmdline, context, content(buffer, sel),
|
}) | gather<Vector>();
|
||||||
ShellManager::Flags::WaitForStdout).first;
|
|
||||||
|
|
||||||
ins.emplace_back(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
selections.set_main_index(old_main);
|
selections.set_main_index(old_main);
|
||||||
selections.insert(ins, mode);
|
selections.insert(ins, mode);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user