From e191a75e336885b4dd8c3d0a80b7b24000a0ca5a Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Thu, 29 Jul 2021 12:53:39 -0700 Subject: [PATCH] Give default document a single line ending. --- helix-view/src/document.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index c2078060e..9eabda463 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1080,7 +1080,7 @@ impl Document { impl Default for Document { fn default() -> Self { - let text = Rope::from(""); + let text = Rope::from(DEFAULT_LINE_ENDING.as_str()); Self::from(text, None) } } @@ -1205,7 +1205,10 @@ mod test { #[test] fn test_line_ending() { - assert_eq!(Document::default().text().to_string(), ""); + assert_eq!( + Document::default().text().to_string(), + DEFAULT_LINE_ENDING.as_str() + ); } macro_rules! test_decode {