on master help sign in
Give default document a single line ending.
e191a75Nathan Vegdahl
helix-view/src/document.rs+5−2
@@ -1080,7 +1080,7 @@ impl Document {
1080
1080
1081impl Default for Document {
1081impl Default for Document {
1082 fn default() -> Self {
1082 fn default() -> Self {
1083− let text = Rope::from("");
1083+ let text = Rope::from(DEFAULT_LINE_ENDING.as_str());
1084 Self::from(text, None)
1084 Self::from(text, None)
1085 }
1085 }
1086}
1086}
@@ -1205,7 +1205,10 @@ mod test {
1205
1205
1206 #[test]
1206 #[test]
1207 fn test_line_ending() {
1207 fn test_line_ending() {
1208+ assert_eq!(
1208− assert_eq!(Document::default().text().to_string(), "");
1209+ Document::default().text().to_string(),
1210+ DEFAULT_LINE_ENDING.as_str()
1211+ );
1209 }
1212 }
1210
1213
1211 macro_rules! test_decode {
1214 macro_rules! test_decode {