Document StripAnsiMode and its variants with doc comments

This commit is contained in:
yuwk committed 2026-10-15 09:37:35 +08:00
1 parent 62b439dae3
commit d50b53d0ef
1 file changed
+10
+10
View File
@@ -302,11 +302,21 @@ pub fn strip_overstrike(line: &str, first_backspace: usize) -> String {
output output
} }
/// Specify when to strip ANSI escape sequences from the input.
///
/// Used for both the `--strip-ansi` and the `--sanitize` option, the latter
/// implying the former with the same value.
#[derive(Debug, PartialEq, Clone, Copy, Default)] #[derive(Debug, PartialEq, Clone, Copy, Default)]
pub enum StripAnsiMode { pub enum StripAnsiMode {
/// Keep escape sequences in the output
#[default] #[default]
Never, Never,
/// Strip escape sequences from the output
Always, Always,
/// Strip escape sequences unless the syntax highlighting language is plain
/// text, in which case they may be part of what the input wants to display
Auto, Auto,
} }