From 68223bdb67e8d7b2c78ad59fc82a3e4b832c3895 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 22 Nov 2021 15:53:37 -0700 Subject: [PATCH] Place the cursor at end of first line when splitting selections into lines --- crates/editor/src/lib.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/crates/editor/src/lib.rs b/crates/editor/src/lib.rs index 158b2823b44e76b686fcb6bcfbdaf76a0b5273dc..b2bc2ed8fda89cb40e78adc87f6cec0417160b52 100644 --- a/crates/editor/src/lib.rs +++ b/crates/editor/src/lib.rs @@ -1999,16 +1999,7 @@ impl Editor { let mut to_unfold = Vec::new(); let mut new_selections = Vec::new(); for selection in selections.iter() { - if selection.start.row != selection.end.row { - new_selections.push(Selection { - id: post_inc(&mut self.next_selection_id), - start: selection.start, - end: selection.start, - reversed: false, - goal: SelectionGoal::None, - }); - } - for row in selection.start.row + 1..selection.end.row { + for row in selection.start.row..selection.end.row { let cursor = Point::new(row, buffer.line_len(row)); new_selections.push(Selection { id: post_inc(&mut self.next_selection_id),