From cde8d7d747261e1c52763a3e88b3c73a640ab01b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 21 Jun 2023 11:53:11 -0600 Subject: [PATCH] Don't use test-only method; add ctrl-j binding Co-Authored-By: Conrad Irwin --- assets/keymaps/default.json | 1 + crates/editor/src/editor.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/keymaps/default.json b/assets/keymaps/default.json index a642697a37..84b11b53a1 100644 --- a/assets/keymaps/default.json +++ b/assets/keymaps/default.json @@ -411,6 +411,7 @@ "ctrl-shift-k": "editor::DeleteLine", "cmd-shift-d": "editor::DuplicateLine", "cmd-shift-l": "editor::SplitSelectionIntoLines", + "ctrl-j": "editor::JoinLines", "ctrl-cmd-up": "editor::MoveLineUp", "ctrl-cmd-down": "editor::MoveLineDown", "ctrl-alt-backspace": "editor::DeleteToPreviousSubwordStart", diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index e5fa551b3b..c8daff3fd5 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -3956,7 +3956,7 @@ impl Editor { pub fn join_lines(&mut self, _: &JoinLines, cx: &mut ViewContext) { let mut row_ranges = Vec::>::new(); - for selection in self.selections.ranges::(cx) { + for selection in self.selections.all::(cx) { let start = selection.start.row; let end = if selection.start.row == selection.end.row { selection.start.row + 1