@@ -275,6 +275,7 @@ impl MappableCommand {
275275 select_regex, "Select all regex matches inside selections",
276276 split_selection, "Split selections on regex matches",
277277 split_selection_on_newline, "Split selection on newlines",
278+ merge_selections, "Merge selections",
278279 merge_consecutive_selections, "Merge consecutive selections",
279280 search, "Search for regex pattern",
280281 rsearch, "Reverse search for regex pattern",
@@ -1737,6 +1738,12 @@ fn split_selection_on_newline(cx: &mut Context) {
17371738 doc.set_selection(view.id, selection);
17381739}
17391740
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);
1745+}
1746+
17401747fn merge_consecutive_selections(cx: &mut Context) {
17411748 let (view, doc) = current!(cx.editor);
17421749 let selection = doc.selection(view.id).clone().merge_consecutive_ranges();