on master help sign in
doc.line_ending() now returns &'static str
commit7cf0fa05a4ca6bf62d38836f3aa99a1ac585a261 authorJan Hrastnik <jan.hrastnik2@gmail.com> dateWed 16 Jun 2021, 16:57 (5 years ago) parenta4f5a01
2 files changed+3−3
helix-term/src/commands.rs+2−2 helix-view/src/document.rs+1−1
helix-term/src/commands.rs+2−2
@@ -348,7 +348,7 @@ where
348348 KeyEvent {
349349 code: KeyCode::Enter,
350350 ..
351− } => '\n', // TODO: we should be calling doc.line_ending() here
351+ } => '\n',
352352 KeyEvent {
353353 code: KeyCode::Char(ch),
354354 ..
@@ -476,7 +476,7 @@ pub fn replace(cx: &mut Context) {
476476 KeyEvent {
477477 code: KeyCode::Enter,
478478 ..
479− } => Some('\n'), // TODO: we should be calling doc.line_ending() here
479+ } => Some('\n'),
480480 _ => None,
481481 };
482482
helix-view/src/document.rs+1−1
@@ -741,7 +741,7 @@ impl Document {
741741 self.diagnostics = diagnostics;
742742 }
743743
744− pub fn line_ending(&self) -> &str {
744+ pub fn line_ending(&self) -> &'static str {
745745 match self.line_ending {
746746 LineEnding::Crlf => "\u{000D}\u{000A}",
747747 LineEnding::LF => "\u{000A}",