pub struct DirPicker {
pub dirs: Vec<PathBuf>,
pub current: PathBuf,
pub selected: usize,
}Fields§
§dirs: Vec<PathBuf>Snapshot of recent dirs at open time. Already in “most recent
first” order; includes the current working directory at index 0
(seeded at startup / refreshed on every apply_cd).
current: PathBufThe working dir at open time — used to label the matching entry
as (current) so users can tell which one they’re already on.
selected: usizeIndex into dirs.
Implementations§
Trait Implementations§
Source§impl Modal for DirPicker
impl Modal for DirPicker
Source§fn handle_key(
&mut self,
code: KeyCode,
_mods: KeyModifiers,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_key( &mut self, code: KeyCode, _mods: KeyModifiers, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
Process one keystroke. Must either fully handle it (including
any re-paint the modal wants) or report that the modal is now
done so the caller can tear it down.
Source§fn draw(
&self,
buf: &Buffer,
state: &UiState,
ctx: &LoopCtx,
renderer: &mut dyn Renderer,
)
fn draw( &self, buf: &Buffer, state: &UiState, ctx: &LoopCtx, renderer: &mut dyn Renderer, )
Paint the modal against the current terminal state. Called once
when the modal is installed into
active_modal; handle_key
is expected to handle subsequent repaints after each key.Source§fn handle_paste(
&mut self,
text: &str,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_paste( &mut self, text: &str, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
Handle a bracketed-paste payload while the modal is active.
Default: append the text to
buf (so text-input wizard steps
naturally accept URL / API-key paste) and redraw. Modals that
only present pickers (no text input) can leave the default —
buf updates are harmless when the modal isn’t displaying it.Auto Trait Implementations§
impl Freeze for DirPicker
impl RefUnwindSafe for DirPicker
impl Send for DirPicker
impl Sync for DirPicker
impl Unpin for DirPicker
impl UnsafeUnpin for DirPicker
impl UnwindSafe for DirPicker
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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