pub struct SplitState {
pub kind: SplitKind,
pub ratio: f32,
pub focus: usize,
pub panes: Vec<Pane>,
pub pending_chord: bool,
}Fields§
§kind: SplitKind§ratio: f32Divider position for the 2-pane case (drag-resize); ≥3 panes are equal.
focus: usizeFocused pane index.
panes: Vec<Pane>§pending_chord: boolAfter Ctrl+W waiting for chord
Implementations§
Source§impl SplitState
impl SplitState
pub fn new() -> Self
pub fn is_split(&self) -> bool
pub fn pane_count(&self) -> usize
pub fn focused_pane(&self) -> &Pane
pub fn focused_pane_mut(&mut self) -> &mut Pane
Sourcepub fn open_split(
&mut self,
kind: SplitKind,
tab: usize,
scroll: usize,
cursor: (usize, usize),
) -> SplitAdd
pub fn open_split( &mut self, kind: SplitKind, tab: usize, scroll: usize, cursor: (usize, usize), ) -> SplitAdd
Open a split of the given kind over the current tab/scroll, or add another pane when already split in the same direction.
Sourcepub fn remove_focused(&mut self) -> Option<Pane>
pub fn remove_focused(&mut self) -> Option<Pane>
Remove the focused pane; focus lands on the neighbor. Returns the surviving pane snapshot to adopt when the split collapses to one.
pub fn close(&mut self)
pub fn focus_other(&mut self)
pub fn set_focus(&mut self, idx: usize)
pub fn adjust_ratio(&mut self, delta: f32)
pub fn equalize(&mut self)
Sourcepub fn clamp_tabs(&mut self, n_tabs: usize)
pub fn clamp_tabs(&mut self, n_tabs: usize)
Keep pane tab indices valid after tab close/reorder.
Trait Implementations§
Source§impl Clone for SplitState
impl Clone for SplitState
Source§fn clone(&self) -> SplitState
fn clone(&self) -> SplitState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SplitState
impl Debug for SplitState
Auto Trait Implementations§
impl Freeze for SplitState
impl RefUnwindSafe for SplitState
impl Send for SplitState
impl Sync for SplitState
impl Unpin for SplitState
impl UnsafeUnpin for SplitState
impl UnwindSafe for SplitState
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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> 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>
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 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>
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