summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-08-07 23:25:54 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-08-07 23:25:54 +0200
commit25a1a9c1599cd20de4a79affe642ebfde9c705c7 (patch)
tree181d1ab6946e9ccb5574fea0746ad131acb576e9 /src
parent8e0f99a03b0704b95c98b92deeb8041eb9703933 (diff)
Fix do_pipe
Diffstat (limited to 'src')
-rw-r--r--src/main.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main.cc b/src/main.cc
index 1adbf3e0..68e32262 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -184,15 +184,12 @@ void do_pipe(Context& context)
{
auto cmdline = prompt("|", context, complete_nothing);
- context.buffer().begin_undo_group();
+ Editor& editor = context.editor();
+ std::vector<String> strings;
for (auto& sel : const_cast<const Editor&>(context.editor()).selections())
- {
- String new_content = ShellManager::instance().pipe(String(sel.begin(), sel.end()),
- cmdline, context, {});
- context.buffer().modify(Modification::make_erase(sel.begin(), sel.end()));
- context.buffer().modify(Modification::make_insert(sel.begin(), new_content));
- }
- context.buffer().end_undo_group();
+ strings.push_back(ShellManager::instance().pipe(String(sel.begin(), sel.end()),
+ cmdline, context, {}));
+ editor.replace(strings);
}
catch (prompt_aborted&) {}
}