Fix flipped condition where Helix adds a line ending on open.
commit0cbaa998ce3666285e543b9b1abfa8fa4764c446
authorNathan Vegdahl <cessen@cessen.com>
dateTue 22 Jun 2021, 17:36 (5 years ago)
parent38bf9c2
helix-view/src/document.rs+1−1
@@ -260,7 +260,7 @@ impl Document {
260260 let line_ending = auto_detect_line_ending(&doc).unwrap_or(DEFAULT_LINE_ENDING);
261261
262262 // 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)) {
264264 doc.insert(doc.len_chars(), line_ending.as_str());
265265 }
266266