diff options
author | Blaž Hrastnik | 2021-06-22 02:09:19 +0000 |
---|---|---|
committer | GitHub | 2021-06-22 02:09:19 +0000 |
commit | a70de6e980ec58cabf58c33e8b91bfafbea312eb (patch) | |
tree | 476c07b84ee3f399eb55c8b549641a59eedc4e1c /helix-view/src/editor.rs | |
parent | c704970fd71a1a29ef8397ff2ab9e12c5b780a81 (diff) | |
parent | f2954fa153ccb6b147d8d38020341a2f1b0b6df2 (diff) |
Merge pull request #224 from helix-editor/line_ending_detection
Line ending detection
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r-- | helix-view/src/editor.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 5d18030a..839bcdcd 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -15,10 +15,9 @@ use slotmap::SlotMap; use anyhow::Error; -use helix_core::Position; - pub use helix_core::diagnostic::Severity; pub use helix_core::register::Registers; +use helix_core::{Position, DEFAULT_LINE_ENDING}; #[derive(Debug)] pub struct Editor { @@ -173,7 +172,7 @@ impl Editor { pub fn new_file(&mut self, action: Action) -> DocumentId { use helix_core::Rope; - let doc = Document::new(Rope::from("\n")); + let doc = Document::new(Rope::from(DEFAULT_LINE_ENDING.as_str())); let id = self.documents.insert(doc); self.documents[id].id = id; self.switch(id, action); |