pub struct LineEndingsDialog { /* private fields */ }Expand description
Line-endings dialog.
Holds a snapshot of the initial LineEndingConfig and a mutable
pending copy that tracks the user’s edits. Emits
DialogAction::ApplyLineEndingsLive on F2 / Enter on
[Apply live], DialogAction::ApplyLineEndingsAndSave on F10
/ Enter on [Apply + Save], and DialogOutcome::Close on
Esc / Enter on [Cancel].
After emitting an Action, the dialog stays open — T17 wires the
outer TuiApp to pop the stack once the action has been applied.
Implementations§
Source§impl LineEndingsDialog
impl LineEndingsDialog
Sourcepub const fn new(initial_config: LineEndingConfig) -> Self
pub const fn new(initial_config: LineEndingConfig) -> Self
Construct a dialog seeded with initial_config. The cursor
starts on the omap row.
Sourcepub const fn cursor(&self) -> usize
pub const fn cursor(&self) -> usize
Current cursor position. Valid range is 0..6: indices 0..=2
select a mapper field (omap / imap / emap), and 3..=5 select
one of the action buttons (Apply live / Apply + Save / Cancel).
Sourcepub const fn pending(&self) -> &LineEndingConfig
pub const fn pending(&self) -> &LineEndingConfig
The currently pending LineEndingConfig; reflects every
committed edit since construction.
Trait Implementations§
Source§impl Dialog for LineEndingsDialog
impl Dialog for LineEndingsDialog
Source§fn preferred_size(&self, outer: Rect) -> Rect
fn preferred_size(&self, outer: Rect) -> Rect
outer. Read moreSource§fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
Auto Trait Implementations§
impl Freeze for LineEndingsDialog
impl RefUnwindSafe for LineEndingsDialog
impl Send for LineEndingsDialog
impl Sync for LineEndingsDialog
impl Unpin for LineEndingsDialog
impl UnsafeUnpin for LineEndingsDialog
impl UnwindSafe for LineEndingsDialog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more