mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-24 07:53:41 +03:00
Merge remote-tracking branch 'lenormf/reevaluate-exclamation-point'
This commit is contained in:
commit
32157a5809
@ -637,10 +637,26 @@ void insert_output(Context& context, NormalParams)
|
||||
if (cmdline.empty())
|
||||
return;
|
||||
|
||||
auto str = ShellManager::instance().eval(
|
||||
cmdline, context, {}, ShellManager::Flags::WaitForStdout).first;
|
||||
ScopedEdition edition(context);
|
||||
context.selections().insert(str, mode);
|
||||
Buffer& buffer = context.buffer();
|
||||
auto& shell_manager = ShellManager::instance();
|
||||
auto& selections = context.selections();
|
||||
Vector<String> ins;
|
||||
const size_t old_main = selections.main_index();
|
||||
|
||||
for (size_t i = 0; i < selections.size(); i++)
|
||||
{
|
||||
selections.set_main_index(i);
|
||||
|
||||
auto& sel = selections.main();
|
||||
auto str = shell_manager.eval(cmdline, context, content(buffer, sel),
|
||||
ShellManager::Flags::WaitForStdout).first;
|
||||
|
||||
ins.emplace_back(str);
|
||||
}
|
||||
|
||||
selections.set_main_index(old_main);
|
||||
selections.insert(ins, mode);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user