aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorJan Hrastnik2021-06-17 11:49:50 +0000
committerJan Hrastnik2021-06-17 11:49:50 +0000
commit8bccd6df3054143baf128157d8dcecb10a911956 (patch)
tree86b4cb7c8c369b554e6cde8aac44061bd2bb6afc /helix-view
parent9c3eadb2e4fd297abcc8ceb02b3088ab3b9b1ceb (diff)
applied changes from pr review
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/document.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index bf26d8a0..fe06d09d 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -63,7 +63,7 @@ pub struct Document {
diagnostics: Vec<Diagnostic>,
language_server: Option<Arc<helix_lsp::Client>>,
- pub line_ending: LineEnding,
+ line_ending: LineEnding,
}
use std::fmt;
@@ -728,18 +728,8 @@ impl Document {
self.diagnostics = diagnostics;
}
- pub fn line_ending(&self) -> &'static str {
- match self.line_ending {
- LineEnding::Crlf => "\u{000D}\u{000A}",
- LineEnding::LF => "\u{000A}",
- LineEnding::Nel => "\u{0085}",
- LineEnding::LS => "\u{2028}",
- LineEnding::CR => "\u{000D}",
- _ => panic!(
- "Unexpected line ending: {:?}, expected Crlf, LF, CR, Nel, or LS.",
- self.line_ending
- ),
- }
+ pub fn line_ending(&self) -> LineEnding {
+ self.line_ending
}
}