Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/edit/src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ impl TextBuffer {
}
}

// We'll assume CRLF if more than half of the lines end in CRLF.
let newlines_are_crlf = crlf_count >= lines / 2;
// We'll assume CRLF if more than half of the lines end in CRLF. If there is only a single line, we'll use the platform default.
let newlines_are_crlf = if lines == 0 { cfg!(windows) } else { crlf_count > lines / 2 };

// We'll assume tabs if there are more lines starting with tabs than with spaces.
let indent_with_tabs = tab_indentations > space_indentations;
Expand Down