aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorNathan Vegdahl2021-06-23 00:36:29 +0000
committerBlaž Hrastnik2021-06-23 03:43:09 +0000
commit0cbaa998ce3666285e543b9b1abfa8fa4764c446 (patch)
treea690f35f05111b5bd0b1cb92070c17957e4f1b7b /helix-view
parent38bf9c25761a9e56e1c4e4fe2894a205ecf7718d (diff)
Fix flipped condition where Helix adds a line ending on open.
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/document.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index f0d7b55a..d3c6cf9e 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -260,7 +260,7 @@ impl Document {
let line_ending = auto_detect_line_ending(&doc).unwrap_or(DEFAULT_LINE_ENDING);
// add missing newline at the end of file
- if doc.len_bytes() == 0 || char_is_line_ending(doc.char(doc.len_chars() - 1)) {
+ if doc.len_bytes() == 0 || !char_is_line_ending(doc.char(doc.len_chars() - 1)) {
doc.insert(doc.len_chars(), line_ending.as_str());
}