diff options
-rw-r--r-- | helix-term/src/commands.rs | 4 | ||||
-rw-r--r-- | helix-view/src/document.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 144e1f3c..31e80345 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -348,7 +348,7 @@ where KeyEvent { code: KeyCode::Enter, .. - } => '\n', // TODO: we should be calling doc.line_ending() here + } => '\n', KeyEvent { code: KeyCode::Char(ch), .. @@ -476,7 +476,7 @@ pub fn replace(cx: &mut Context) { KeyEvent { code: KeyCode::Enter, .. - } => Some('\n'), // TODO: we should be calling doc.line_ending() here + } => Some('\n'), _ => None, }; diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 5f61f05a..c15a42ab 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -741,7 +741,7 @@ impl Document { self.diagnostics = diagnostics; } - pub fn line_ending(&self) -> &str { + pub fn line_ending(&self) -> &'static str { match self.line_ending { LineEnding::Crlf => "\u{000D}\u{000A}", LineEnding::LF => "\u{000A}", |