join_lines: Skip over leading indentation

This commit is contained in:
Conrad Irwin 2023-06-21 13:14:21 -06:00
parent a365b2f177
commit 91bd8e305e
2 changed files with 31 additions and 2 deletions

View file

@ -3987,9 +3987,10 @@ impl Editor {
for row_range in row_ranges.into_iter().rev() {
for row in row_range.rev() {
let end_of_line = Point::new(row, snapshot.line_len(row));
let start_of_next_line = end_of_line + Point::new(1, 0);
let indent = snapshot.indent_size_for_line(row + 1);
let start_of_next_line = Point::new(row + 1, indent.len);
let replace = if snapshot.line_len(row + 1) > 0 {
let replace = if snapshot.line_len(row + 1) > indent.len {
" "
} else {
""