on master help sign in
Fix flipped condition where Helix adds a line ending on open.
0cbaa99Nathan Vegdahl
helix-view/src/document.rs+1−1
@@ -260,7 +260,7 @@ impl Document {
260 let line_ending = auto_detect_line_ending(&doc).unwrap_or(DEFAULT_LINE_ENDING);
260 let line_ending = auto_detect_line_ending(&doc).unwrap_or(DEFAULT_LINE_ENDING);
261
261
262 // add missing newline at the end of file
262 // add missing newline at the end of file
263− if doc.len_bytes() == 0 || char_is_line_ending(doc.char(doc.len_chars() - 1)) {
263+ if doc.len_bytes() == 0 || !char_is_line_ending(doc.char(doc.len_chars() - 1)) {
264 doc.insert(doc.len_chars(), line_ending.as_str());
264 doc.insert(doc.len_chars(), line_ending.as_str());
265 }
265 }
266
266