pub struct Jump { /* private fields */ }Expand description
The jump picker’s state: the query line (an editable tui_input::Input), the
candidate set (built once on open), the ranked results, and view state
(selection + scroll).
Implementations§
Source§impl Jump
impl Jump
Sourcepub fn open(tree: &Tree) -> Self
pub fn open(tree: &Tree) -> Self
Open a picker over every node in the current tree view, ranked for the empty query (i.e. all candidates in tree order).
Sourcepub fn handle_key(&mut self, key: Key) -> JumpOutcome
pub fn handle_key(&mut self, key: Key) -> JumpOutcome
Route a key to the picker. Result-navigation, accept, and cancel keys are
handled here; everything else is offered to the query line’s tui_input
editor. All of these are fixed (not the user’s configurable keymap — see
the v1 boundary in app.rs).
pub fn query(&self) -> &str
Sourcepub fn visual_cursor(&self) -> usize
pub fn visual_cursor(&self) -> usize
The caret’s display column within the query text (accounts for wide
characters); pairs with Jump::visual_scroll for rendering.
Sourcepub fn visual_scroll(&self, width: usize) -> usize
pub fn visual_scroll(&self, width: usize) -> usize
The horizontal scroll offset (in display columns) that keeps the caret
visible in a query field width columns wide.
pub fn results(&self) -> &[Match]
pub fn selected(&self) -> usize
pub fn scroll(&self) -> usize
Sourcepub fn path(&self, id: NodeId) -> &str
pub fn path(&self, id: NodeId) -> &str
The path text for a node id (what was matched, and what is displayed).
Sourcepub fn set_viewport(&mut self, rows: usize)
pub fn set_viewport(&mut self, rows: usize)
Tell the picker how many result rows the viewport can show, keeping the selection visible. Called by the renderer each frame.
Auto Trait Implementations§
impl Freeze for Jump
impl RefUnwindSafe for Jump
impl Send for Jump
impl Sync for Jump
impl Unpin for Jump
impl UnsafeUnpin for Jump
impl UnwindSafe for Jump
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> 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