aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
authorNathan Vegdahl2021-06-20 22:09:10 +0000
committerNathan Vegdahl2021-06-20 22:33:02 +0000
commit4efd6713c5b30b33c497a1f85b77a7b0a7fd17e0 (patch)
tree7661f09f2279a3f9ae6a8f76770a69fd08f95981 /helix-view/src/editor.rs
parent5d22e3c4e574eb24260966de7f20f582e6184e24 (diff)
Work on moving code over to LineEnding instead of assuming '\n'.
Also some general cleanup and some minor fixes along the way.
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index db8ae87a..fb2eb36d 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -12,7 +12,7 @@ use anyhow::Error;
pub use helix_core::diagnostic::Severity;
pub use helix_core::register::Registers;
-use helix_core::Position;
+use helix_core::{Position, DEFAULT_LINE_ENDING};
#[derive(Debug)]
pub struct Editor {
@@ -150,7 +150,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);