diff options
author | Blaž Hrastnik | 2022-03-16 09:02:37 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-03-17 00:29:47 +0000 |
commit | f67e1ee1723592a4e6279197317d46759cd05976 (patch) | |
tree | 023d8cf1dd6a83f867cc74b2f9eeec5e117e5e21 /helix-term/src | |
parent | b4a282fd360a6cd8a03f7b1d784dafe5bc4c8abc (diff) |
Put esoteric line endings behind a feature flag
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands/typed.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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"), }; |