From 8bccd6df3054143baf128157d8dcecb10a911956 Mon Sep 17 00:00:00 2001 From: Jan Hrastnik Date: Thu, 17 Jun 2021 13:49:50 +0200 Subject: applied changes from pr review --- helix-view/src/document.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'helix-view') 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, language_server: Option>, - 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 } } -- cgit v1.2.3-70-g09d2