From f67e1ee1723592a4e6279197317d46759cd05976 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 16 Mar 2022 18:02:37 +0900 Subject: Put esoteric line endings behind a feature flag --- helix-term/src/commands/typed.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'helix-term/src/commands') diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 0801b236..d35b7082 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -288,11 +288,15 @@ fn set_line_ending( cx.editor.set_status(match line_ending { Crlf => "crlf", LF => "line feed", + #[cfg(feature = "unicode-lines")] FF => "form feed", + #[cfg(feature = "unicode-lines")] CR => "carriage return", + #[cfg(feature = "unicode-lines")] Nel => "next line", // These should never be a document's default line ending. + #[cfg(feature = "unicode-lines")] VT | LS | PS => "error", }); @@ -307,10 +311,13 @@ fn set_line_ending( // Attempt to parse argument as a line ending. let line_ending = match arg { // We check for CR first because it shares a common prefix with CRLF. + #[cfg(feature = "unicode-lines")] arg if arg.starts_with("cr") => CR, arg if arg.starts_with("crlf") => Crlf, arg if arg.starts_with("lf") => LF, + #[cfg(feature = "unicode-lines")] arg if arg.starts_with("ff") => FF, + #[cfg(feature = "unicode-lines")] arg if arg.starts_with("nel") => Nel, _ => bail!("invalid line ending"), }; -- cgit v1.2.3-70-g09d2