pub struct NavigationState {Show 13 fields
pub selected_row: usize,
pub selected_column: usize,
pub scroll_offset: (usize, usize),
pub viewport_rows: usize,
pub viewport_columns: usize,
pub total_rows: usize,
pub total_columns: usize,
pub last_visible_rows: usize,
pub viewport_lock: bool,
pub viewport_lock_row: Option<usize>,
pub cursor_lock: bool,
pub cursor_lock_position: Option<usize>,
pub selection_history: VecDeque<(usize, usize)>,
}
Expand description
Navigation and viewport state
Fields§
§selected_row: usize
§selected_column: usize
§scroll_offset: (usize, usize)
§viewport_rows: usize
§viewport_columns: usize
§total_rows: usize
§total_columns: usize
§last_visible_rows: usize
§viewport_lock: bool
§viewport_lock_row: Option<usize>
§cursor_lock: bool
§cursor_lock_position: Option<usize>
§selection_history: VecDeque<(usize, usize)>
Implementations§
pub fn new() -> Self
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset navigation state to initial values (used when executing new queries)
pub fn update_totals(&mut self, rows: usize, columns: usize)
pub fn set_viewport_size(&mut self, rows: usize, columns: usize)
Sourcepub fn previous_row(&mut self) -> bool
pub fn previous_row(&mut self) -> bool
Move to previous row
Sourcepub fn next_column(&mut self) -> bool
pub fn next_column(&mut self) -> bool
Move to next column
Sourcepub fn previous_column(&mut self) -> bool
pub fn previous_column(&mut self) -> bool
Move to previous column
Sourcepub fn jump_to_row(&mut self, row: usize)
pub fn jump_to_row(&mut self, row: usize)
Jump to specific row
Sourcepub fn jump_to_first_row(&mut self)
pub fn jump_to_first_row(&mut self)
Jump to first row
Sourcepub fn jump_to_last_row(&mut self)
pub fn jump_to_last_row(&mut self)
Jump to last row
Sourcepub fn set_position(&mut self, row: usize, column: usize)
pub fn set_position(&mut self, row: usize, column: usize)
Set selected position
Sourcepub fn jump_to_viewport_top(&mut self)
pub fn jump_to_viewport_top(&mut self)
Jump to top of viewport (H in vim)
Sourcepub fn jump_to_viewport_middle(&mut self)
pub fn jump_to_viewport_middle(&mut self)
Jump to middle of viewport (M in vim)
Sourcepub fn jump_to_viewport_bottom(&mut self)
pub fn jump_to_viewport_bottom(&mut self)
Jump to bottom of viewport (L in vim)
pub fn is_position_visible(&self, row: usize, col: usize) -> bool
pub fn ensure_visible(&mut self, row: usize, col: usize)
Sourcepub fn is_at_viewport_top(&self) -> bool
pub fn is_at_viewport_top(&self) -> bool
Check if cursor is at top of viewport
Sourcepub fn is_at_viewport_bottom(&self) -> bool
pub fn is_at_viewport_bottom(&self) -> bool
Check if cursor is at bottom of viewport
Sourcepub fn get_position_status(&self) -> String
pub fn get_position_status(&self) -> String
Get position description for status
pub fn add_to_history(&mut self, row: usize, col: usize)
Trait Implementations§
Source§fn clone(&self) -> NavigationState
fn clone(&self) -> NavigationState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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