@@ -31,7 +31,6 @@ use helix_core::{
3131 line_ending::auto_detect_line_ending,
3232 syntax::{self, LanguageConfiguration},
3333 ChangeSet, Diagnostic, LineEnding, Range, Rope, RopeBuilder, Selection, Syntax, Transaction,
34− NATIVE_LINE_ENDING,
3534};
3635
3736use crate::editor::{Config, RedrawHandle};
@@ -625,7 +624,8 @@ impl Document {
625624 }
626625
627626 pub fn default(config: Arc<dyn DynAccess<Config>>) -> Self {
628− let text = Rope::from(NATIVE_LINE_ENDING.as_str());
627+ let line_ending: LineEnding = config.load().default_line_ending.into();
628+ let text = Rope::from(line_ending.as_str());
629629 Self::from(text, None, config)
630630 }
631631
@@ -644,8 +644,9 @@ impl Document {
644644 std::fs::File::open(path).context(format!("unable to open {:?}", path))?;
645645 from_reader(&mut file, encoding)?
646646 } else {
647+ let line_ending: LineEnding = config.load().default_line_ending.into();
647648 let encoding = encoding.unwrap_or(encoding::UTF_8);
648− (Rope::from(NATIVE_LINE_ENDING.as_str()), encoding, false)
649+ (Rope::from(line_ending.as_str()), encoding, false)
649650 };
650651
651652 let mut doc = Self::from(rope, Some((encoding, has_bom)), config);
@@ -1925,7 +1926,7 @@ mod test {
19251926 Document::default(Arc::new(ArcSwap::new(Arc::new(Config::default()))))
19261927 .text()
19271928 .to_string(),
1928− NATIVE_LINE_ENDING.as_str()
1929+ helix_core::NATIVE_LINE_ENDING.as_str()
19291930 );
19301931 }
19311932