pub struct CompositeViewState {
pub composite_id: BufferId,
pub pane_viewports: Vec<PaneViewport>,
pub focused_pane: usize,
pub scroll_row: usize,
pub cursor_row: usize,
pub cursor_column: usize,
pub sticky_column: usize,
pub pane_cursors: Vec<Cursors>,
pub pane_widths: Vec<u16>,
pub visual_mode: bool,
pub selection_anchor_row: usize,
pub selection_anchor_column: usize,
}Expand description
View state for a composite buffer in a split
Fields§
§composite_id: BufferIdThe composite buffer being displayed
pane_viewports: Vec<PaneViewport>Independent viewport per pane
focused_pane: usizeWhich pane has focus (0-indexed)
scroll_row: usizeSingle scroll position (display row) All panes scroll together via alignment
cursor_row: usizeCurrent cursor row (for navigation highlighting)
cursor_column: usizeCurrent cursor column within the focused pane
sticky_column: usizeDesired column for vertical navigation (sticky column) When moving up/down, the cursor tries to return to this column
pane_cursors: Vec<Cursors>Cursor positions per pane (for editing)
pane_widths: Vec<u16>Width of each pane (computed during render)
visual_mode: boolWhether visual selection mode is active
selection_anchor_row: usizeSelection anchor row (where selection started)
selection_anchor_column: usizeSelection anchor column (where selection started)
Implementations§
Source§impl CompositeViewState
impl CompositeViewState
Sourcepub fn new(composite_id: BufferId, pane_count: usize) -> Self
pub fn new(composite_id: BufferId, pane_count: usize) -> Self
Create a new composite view state for the given buffer
Sourcepub fn start_visual_selection(&mut self)
pub fn start_visual_selection(&mut self)
Start visual selection at current cursor position
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear visual selection
Sourcepub fn selection_row_range(&self) -> Option<(usize, usize)>
pub fn selection_row_range(&self) -> Option<(usize, usize)>
Get selection row range (start_row, end_row) inclusive Returns None if not in visual mode
Sourcepub fn is_row_selected(&self, row: usize) -> bool
pub fn is_row_selected(&self, row: usize) -> bool
Check if a row is within the selection
Sourcepub fn selection_column_range(&self, row: usize) -> Option<(usize, usize)>
pub fn selection_column_range(&self, row: usize) -> Option<(usize, usize)>
Get the column range that is selected for a given row Returns (start_col, end_col) where end_col is exclusive Returns None if row is not in selection
Sourcepub fn move_cursor_down(&mut self, max_row: usize, viewport_height: usize)
pub fn move_cursor_down(&mut self, max_row: usize, viewport_height: usize)
Move cursor down, auto-scrolling if needed. Keeps cursor at least SCROLL_MARGIN lines from the bottom edge of the viewport.
Sourcepub fn move_cursor_up(&mut self, viewport_height: usize)
pub fn move_cursor_up(&mut self, viewport_height: usize)
Move cursor up, auto-scrolling if needed. Keeps cursor at least SCROLL_MARGIN lines from the top edge of the viewport.
Sourcepub fn move_cursor_to_top(&mut self)
pub fn move_cursor_to_top(&mut self)
Move cursor to top
Sourcepub fn move_cursor_to_bottom(&mut self, max_row: usize, viewport_height: usize)
pub fn move_cursor_to_bottom(&mut self, max_row: usize, viewport_height: usize)
Move cursor to bottom
Sourcepub fn move_cursor_left(&mut self)
pub fn move_cursor_left(&mut self)
Move cursor left by one column
Sourcepub fn move_cursor_right(&mut self, max_column: usize, pane_width: usize)
pub fn move_cursor_right(&mut self, max_column: usize, pane_width: usize)
Move cursor right by one column
Sourcepub fn move_cursor_to_line_start(&mut self)
pub fn move_cursor_to_line_start(&mut self)
Move cursor to start of line
Sourcepub fn move_cursor_to_line_end(&mut self, line_length: usize, pane_width: usize)
pub fn move_cursor_to_line_end(&mut self, line_length: usize, pane_width: usize)
Move cursor to end of line
Sourcepub fn clamp_cursor_to_line(&mut self, line_length: usize)
pub fn clamp_cursor_to_line(&mut self, line_length: usize)
Clamp cursor column to line length, using sticky column if possible Call this after vertical movement to adjust cursor to new line’s length
Sourcepub fn scroll(&mut self, delta: isize, max_row: usize)
pub fn scroll(&mut self, delta: isize, max_row: usize)
Scroll all panes together by delta lines
Sourcepub fn set_scroll_row(&mut self, row: usize, max_row: usize)
pub fn set_scroll_row(&mut self, row: usize, max_row: usize)
Set scroll to a specific row
Sourcepub fn scroll_to_top(&mut self)
pub fn scroll_to_top(&mut self)
Scroll to top
Sourcepub fn scroll_to_bottom(&mut self, total_rows: usize, viewport_height: usize)
pub fn scroll_to_bottom(&mut self, total_rows: usize, viewport_height: usize)
Scroll to bottom
Sourcepub fn focus_next_pane(&mut self)
pub fn focus_next_pane(&mut self)
Switch focus to the next pane
Sourcepub fn focus_prev_pane(&mut self)
pub fn focus_prev_pane(&mut self)
Switch focus to the previous pane
Sourcepub fn set_focused_pane(&mut self, pane_index: usize)
pub fn set_focused_pane(&mut self, pane_index: usize)
Set focus to a specific pane
Sourcepub fn get_pane_viewport(&self, pane_index: usize) -> Option<&PaneViewport>
pub fn get_pane_viewport(&self, pane_index: usize) -> Option<&PaneViewport>
Get the viewport for a specific pane
Sourcepub fn get_pane_viewport_mut(
&mut self,
pane_index: usize,
) -> Option<&mut PaneViewport>
pub fn get_pane_viewport_mut( &mut self, pane_index: usize, ) -> Option<&mut PaneViewport>
Get mutable viewport for a specific pane
Sourcepub fn get_pane_cursor(&self, pane_index: usize) -> Option<&Cursors>
pub fn get_pane_cursor(&self, pane_index: usize) -> Option<&Cursors>
Get the cursor for a specific pane
Sourcepub fn get_pane_cursor_mut(&mut self, pane_index: usize) -> Option<&mut Cursors>
pub fn get_pane_cursor_mut(&mut self, pane_index: usize) -> Option<&mut Cursors>
Get mutable cursor for a specific pane
Sourcepub fn focused_cursor(&self) -> Option<&Cursors>
pub fn focused_cursor(&self) -> Option<&Cursors>
Get the focused pane’s cursor
Sourcepub fn focused_cursor_mut(&mut self) -> Option<&mut Cursors>
pub fn focused_cursor_mut(&mut self) -> Option<&mut Cursors>
Get mutable reference to the focused pane’s cursor
Sourcepub fn update_pane_widths(
&mut self,
total_width: u16,
ratios: &[f32],
separator_width: u16,
)
pub fn update_pane_widths( &mut self, total_width: u16, ratios: &[f32], separator_width: u16, )
Update pane widths based on layout ratios and total width
Trait Implementations§
Source§impl Clone for CompositeViewState
impl Clone for CompositeViewState
Source§fn clone(&self) -> CompositeViewState
fn clone(&self) -> CompositeViewState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CompositeViewState
impl RefUnwindSafe for CompositeViewState
impl Send for CompositeViewState
impl Sync for CompositeViewState
impl Unpin for CompositeViewState
impl UnsafeUnpin for CompositeViewState
impl UnwindSafe for CompositeViewState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more