@@ -275,6 +275,7 @@ impl MappableCommand {
275 select_regex, "Select all regex matches inside selections",
275 select_regex, "Select all regex matches inside selections",
276 split_selection, "Split selections on regex matches",
276 split_selection, "Split selections on regex matches",
277 split_selection_on_newline, "Split selection on newlines",
277 split_selection_on_newline, "Split selection on newlines",
278+ merge_selections, "Merge selections",
278 merge_consecutive_selections, "Merge consecutive selections",
279 merge_consecutive_selections, "Merge consecutive selections",
279 search, "Search for regex pattern",
280 search, "Search for regex pattern",
280 rsearch, "Reverse search for regex pattern",
281 rsearch, "Reverse search for regex pattern",
@@ -1737,6 +1738,12 @@ fn split_selection_on_newline(cx: &mut Context) {
1737 doc.set_selection(view.id, selection);
1738 doc.set_selection(view.id, selection);
1741+fn merge_selections(cx: &mut Context) {
1742+ let (view, doc) = current!(cx.editor);
1743+ let selection = doc.selection(view.id).clone().merge_ranges();
1744+ doc.set_selection(view.id, selection);
1740fn merge_consecutive_selections(cx: &mut Context) {
1747fn merge_consecutive_selections(cx: &mut Context) {
1741 let (view, doc) = current!(cx.editor);
1748 let (view, doc) = current!(cx.editor);
1742 let selection = doc.selection(view.id).clone().merge_consecutive_ranges();
1749 let selection = doc.selection(view.id).clone().merge_consecutive_ranges();