pub struct CopyModeState {
pub active: bool,
pub cursor: CopyModeCursor,
pub selection: Option<Selection>,
pub selection_mode: SelectionMode,
pub viewport_offset: i32,
}Expand description
Copy mode state tracking active mode, cursor, and selection
Fields§
§active: boolWhether copy mode is currently active
cursor: CopyModeCursorCurrent cursor position
selection: Option<Selection>Active selection, if any
selection_mode: SelectionModeCurrent selection mode
viewport_offset: i32Viewport offset (lines scrolled from bottom)
Implementations§
Source§impl CopyModeState
impl CopyModeState
Sourcepub fn activate(&mut self, cursor: CopyModeCursor)
pub fn activate(&mut self, cursor: CopyModeCursor)
Activate copy mode at the current cursor position
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivate copy mode and clear selection
Sourcepub fn start_selection(&mut self, mode: SelectionMode)
pub fn start_selection(&mut self, mode: SelectionMode)
Start a selection at the current cursor position
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear the current selection
Sourcepub fn update_selection(&mut self)
pub fn update_selection(&mut self)
Update the active end of the selection to the current cursor
Sourcepub fn toggle_selection(&mut self, mode: SelectionMode)
pub fn toggle_selection(&mut self, mode: SelectionMode)
Toggle selection mode on/off
Sourcepub fn swap_selection_ends(&mut self)
pub fn swap_selection_ends(&mut self)
Swap the anchor and active ends of the selection
Sourcepub fn move_right(&mut self, max_cols: u16)
pub fn move_right(&mut self, max_cols: u16)
Move cursor right, clamping at max_cols
Sourcepub fn move_to_line_start(&mut self)
pub fn move_to_line_start(&mut self)
Move cursor to column 0 (start of line)
Sourcepub fn move_to_line_end(&mut self, line_length: u16)
pub fn move_to_line_end(&mut self, line_length: u16)
Move cursor to end of line
Sourcepub fn move_to_top(&mut self, min_y: i32)
pub fn move_to_top(&mut self, min_y: i32)
Move cursor to top of scrollback
Sourcepub fn move_to_bottom(&mut self, max_y: i32)
pub fn move_to_bottom(&mut self, max_y: i32)
Move cursor to bottom of screen
Sourcepub fn toggle_cell_selection(&mut self)
pub fn toggle_cell_selection(&mut self)
Toggle cell selection mode
Sourcepub fn toggle_line_selection(&mut self)
pub fn toggle_line_selection(&mut self)
Toggle line selection mode
Sourcepub fn toggle_block_selection(&mut self)
pub fn toggle_block_selection(&mut self)
Toggle block selection mode
Sourcepub fn toggle_word_selection(&mut self)
pub fn toggle_word_selection(&mut self)
Toggle word selection mode
Sourcepub fn get_selection_text<F>(&self, get_line: F) -> Option<String>
pub fn get_selection_text<F>(&self, get_line: F) -> Option<String>
Get the selected text using a callback to retrieve line content
The callback function should take a line number (y coordinate) and return the line content as a String, or None if the line doesn’t exist.
Trait Implementations§
Source§impl Clone for CopyModeState
impl Clone for CopyModeState
Source§fn clone(&self) -> CopyModeState
fn clone(&self) -> CopyModeState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more