summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-12-18 19:00:55 +0100
committerMaxime Coste <frrrwww@gmail.com>2012-12-18 19:00:55 +0100
commitcf7e6bdd078718f31c58127acd5b135886b3cd4f (patch)
tree7696287c1ddff93820b2ee3e7ebdb49b79229f34 /src
parent43ad920bd86af84f6d676b0524983658cae034b9 (diff)
join: preserve multiple selections
Diffstat (limited to 'src')
-rw-r--r--src/main.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cc b/src/main.cc
index 46199734..98b8a88e 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -264,12 +264,12 @@ void do_split_regex(Context& context)
void do_join(Context& context)
{
Editor& editor = context.editor();
+ DynamicSelectionList sels{editor.buffer(), editor.selections()};
editor.select(select_whole_lines);
editor.select(select_to_eol, SelectMode::Extend);
editor.multi_select(std::bind(select_all_matches, _1, "\n\\h*"));
editor.insert(" ", InsertMode::Replace);
- editor.clear_selections();
- editor.move_selections(-1_char);
+ editor.select(sels);
}
void do_indent(Context& context)