pub struct CursorManager { /* private fields */ }
Expand description
Manages all cursor and navigation operations
This extracts cursor logic from the monolithic enhanced_tui.rs
Implementations§
Source§impl CursorManager
impl CursorManager
pub fn new() -> Self
Sourcepub fn move_word_forward(&mut self, text: &str) -> usize
pub fn move_word_forward(&mut self, text: &str) -> usize
Move cursor forward by one word
Sourcepub fn move_word_backward(&mut self, text: &str) -> usize
pub fn move_word_backward(&mut self, text: &str) -> usize
Move cursor backward by one word
Sourcepub fn move_to_line_start(&mut self) -> usize
pub fn move_to_line_start(&mut self) -> usize
Move cursor to beginning of line
Sourcepub fn move_to_line_end(&mut self, text: &str) -> usize
pub fn move_to_line_end(&mut self, text: &str) -> usize
Move cursor to end of line
Sourcepub fn move_right(&mut self, text: &str) -> usize
pub fn move_right(&mut self, text: &str) -> usize
Move cursor right by one character
Sourcepub fn set_position(&mut self, pos: usize)
pub fn set_position(&mut self, pos: usize)
Set cursor position directly
Sourcepub fn move_table_up(&mut self) -> (usize, usize)
pub fn move_table_up(&mut self) -> (usize, usize)
Move selection up in table
Sourcepub fn move_table_down(&mut self, max_rows: usize) -> (usize, usize)
pub fn move_table_down(&mut self, max_rows: usize) -> (usize, usize)
Move selection down in table
Sourcepub fn move_table_left(&mut self) -> (usize, usize)
pub fn move_table_left(&mut self) -> (usize, usize)
Move selection left in table
Sourcepub fn move_table_right(&mut self, max_cols: usize) -> (usize, usize)
pub fn move_table_right(&mut self, max_cols: usize) -> (usize, usize)
Move selection right in table
Sourcepub fn move_table_home(&mut self) -> (usize, usize)
pub fn move_table_home(&mut self) -> (usize, usize)
Move to first row
Sourcepub fn move_table_end(&mut self, max_rows: usize) -> (usize, usize)
pub fn move_table_end(&mut self, max_rows: usize) -> (usize, usize)
Move to last row
Sourcepub fn page_down(&mut self, page_size: usize, max_rows: usize) -> (usize, usize)
pub fn page_down(&mut self, page_size: usize, max_rows: usize) -> (usize, usize)
Page down in table
Sourcepub fn table_position(&self) -> (usize, usize)
pub fn table_position(&self) -> (usize, usize)
Get current table cursor position
Sourcepub fn reset_table_cursor(&mut self)
pub fn reset_table_cursor(&mut self)
Reset table cursor to origin
Sourcepub fn update_horizontal_scroll(
&mut self,
cursor_col: usize,
viewport_width: u16,
)
pub fn update_horizontal_scroll( &mut self, cursor_col: usize, viewport_width: u16, )
Update horizontal scroll based on cursor position and viewport
Sourcepub fn update_vertical_scroll(
&mut self,
cursor_row: usize,
viewport_height: usize,
)
pub fn update_vertical_scroll( &mut self, cursor_row: usize, viewport_height: usize, )
Update vertical scroll based on cursor position and viewport
Sourcepub fn scroll_offsets(&self) -> (u16, usize)
pub fn scroll_offsets(&self) -> (u16, usize)
Get current scroll offsets
Sourcepub fn set_scroll_offsets(&mut self, horizontal: u16, vertical: usize)
pub fn set_scroll_offsets(&mut self, horizontal: u16, vertical: usize)
Set scroll offsets directly
Sourcepub fn reset_horizontal_scroll(&mut self)
pub fn reset_horizontal_scroll(&mut self)
Reset horizontal scroll to zero (useful when switching queries)
Sourcepub fn get_word_at_cursor(&self, text: &str) -> Option<(usize, usize, String)>
pub fn get_word_at_cursor(&self, text: &str) -> Option<(usize, usize, String)>
Find word boundaries at current position
Sourcepub fn get_partial_word_before_cursor(&self, text: &str) -> Option<String>
pub fn get_partial_word_before_cursor(&self, text: &str) -> Option<String>
Get partial word before cursor (for completion)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CursorManager
impl RefUnwindSafe for CursorManager
impl Send for CursorManager
impl Sync for CursorManager
impl Unpin for CursorManager
impl UnwindSafe for CursorManager
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