pub struct FormatOptions<'t, 's> { /* private fields */ }Expand description
Options for one-shot formatting of a terminal selection.
If with_selection is not called, the formatter defaults to
formatting the terminal’s active selection. If there is no active
selection, formatting returns Ok(None).
The selection is formatted from the terminal’s active screen using the same
formatting semantics as Formatter.
For copy/clipboard behavior matching Ghostty’s Screen.selectionString(),
use plain output with unwrap and trim both set to true.
Implementations§
Source§impl<'t, 's> FormatOptions<'t, 's>
impl<'t, 's> FormatOptions<'t, 's>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new set of options for one-shot formatting of a terminal selection.
Sourcepub fn with_emit_format(self, value: Format) -> Self
pub fn with_emit_format(self, value: Format) -> Self
Specify the output format to emit.
Sourcepub fn with_unwrap(self, value: bool) -> Self
pub fn with_unwrap(self, value: bool) -> Self
Specify whether to unwrap soft-wrapped lines.
Sourcepub fn with_trim(self, value: bool) -> Self
pub fn with_trim(self, value: bool) -> Self
Specify whether to trim trailing whitespace on non-blank lines.
Sourcepub fn with_selection(self, value: &'s Selection<'t>) -> Self
pub fn with_selection(self, value: &'s Selection<'t>) -> Self
Specify the selection to format in place of the terminal’s active selection.
The selection must be a valid snapshot selection for this terminal.