CursorManager

Struct CursorManager 

Source
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

Source

pub fn new() -> Self

Source

pub fn move_word_forward(&mut self, text: &str) -> usize

Move cursor forward by one word

Source

pub fn move_word_backward(&mut self, text: &str) -> usize

Move cursor backward by one word

Source

pub fn move_to_line_start(&mut self) -> usize

Move cursor to beginning of line

Source

pub fn move_to_line_end(&mut self, text: &str) -> usize

Move cursor to end of line

Source

pub fn move_left(&mut self) -> usize

Move cursor left by one character

Source

pub fn move_right(&mut self, text: &str) -> usize

Move cursor right by one character

Source

pub fn set_position(&mut self, pos: usize)

Set cursor position directly

Source

pub fn position(&self) -> usize

Get current cursor position

Source

pub fn move_table_up(&mut self) -> (usize, usize)

Move selection up in table

Source

pub fn move_table_down(&mut self, max_rows: usize) -> (usize, usize)

Move selection down in table

Source

pub fn move_table_left(&mut self) -> (usize, usize)

Move selection left in table

Source

pub fn move_table_right(&mut self, max_cols: usize) -> (usize, usize)

Move selection right in table

Source

pub fn move_table_home(&mut self) -> (usize, usize)

Move to first row

Source

pub fn move_table_end(&mut self, max_rows: usize) -> (usize, usize)

Move to last row

Source

pub fn page_up(&mut self, page_size: usize) -> (usize, usize)

Page up in table

Source

pub fn page_down(&mut self, page_size: usize, max_rows: usize) -> (usize, usize)

Page down in table

Source

pub fn table_position(&self) -> (usize, usize)

Get current table cursor position

Source

pub fn reset_table_cursor(&mut self)

Reset table cursor to origin

Source

pub fn update_horizontal_scroll( &mut self, cursor_col: usize, viewport_width: u16, )

Update horizontal scroll based on cursor position and viewport

Source

pub fn update_vertical_scroll( &mut self, cursor_row: usize, viewport_height: usize, )

Update vertical scroll based on cursor position and viewport

Source

pub fn scroll_offsets(&self) -> (u16, usize)

Get current scroll offsets

Source

pub fn set_scroll_offsets(&mut self, horizontal: u16, vertical: usize)

Set scroll offsets directly

Source

pub fn reset_horizontal_scroll(&mut self)

Reset horizontal scroll to zero (useful when switching queries)

Source

pub fn get_word_at_cursor(&self, text: &str) -> Option<(usize, usize, String)>

Find word boundaries at current position

Source

pub fn get_partial_word_before_cursor(&self, text: &str) -> Option<String>

Get partial word before cursor (for completion)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,