pub struct SelectionTracker { /* private fields */ }Expand description
Tracks the active text selection in the terminal grid.
Manages the current selection query and provides methods to update or clear the selection. Uses interior mutability to allow shared access across multiple components.
Implementations§
Source§impl SelectionTracker
impl SelectionTracker
Sourcepub fn clear(&self)
pub fn clear(&self)
Clears the current selection.
Removes any active selection from the terminal grid.
Sourcepub fn query(&self) -> CellQuery
pub fn query(&self) -> CellQuery
Returns the current selection query.
§Panics
Panics if no selection is active. This is internal-only API where a selection is guaranteed to exist when called.
Sourcepub fn get_query(&self) -> Option<CellQuery>
pub fn get_query(&self) -> Option<CellQuery>
Returns the current selection query or None if no selection is active.
Safe version that doesn’t panic when no selection exists.
Sourcepub fn set_query(&self, query: CellQuery)
pub fn set_query(&self, query: CellQuery)
Sets a new selection query.
Replaces any existing selection with the provided query.
Sourcepub fn update_selection_end(&self, end: (u16, u16))
pub fn update_selection_end(&self, end: (u16, u16))
Updates the end position of the current selection.
Used during mouse drag operations to extend the selection.
Sourcepub fn set_content_hash(&self, hash: u64)
pub fn set_content_hash(&self, hash: u64)
Sets the content hash on the current query.
The hash is stored with the query to detect if underlying content changes.
Trait Implementations§
Source§impl Clone for SelectionTracker
impl Clone for SelectionTracker
Source§fn clone(&self) -> SelectionTracker
fn clone(&self) -> SelectionTracker
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more