pub enum PaneNode {
Leaf(usize),
HorizontalSplit {
top: Box<PaneNode>,
bottom: Box<PaneNode>,
ratio: f32,
},
VerticalSplit {
left: Box<PaneNode>,
right: Box<PaneNode>,
ratio: f32,
},
}Expand description
Internal node of the pane tree. Leaves reference a PaneState
by index in PaneTree::leaves; splits hold two children with
an explicit orientation and a ratio. New splits start at
DEFAULT_SPLIT_RATIO; PaneTree::resize_active_split and
PaneTree::equalize_ratios adjust them.
Variants§
Leaf(usize)
A concrete pane. The usize indexes into
PaneTree::leaves.
HorizontalSplit
Two panes stacked top + bottom (a horizontal cut).
ratio is the top child’s share of the total height,
clamped to MIN_SPLIT_RATIO..=MAX_SPLIT_RATIO. Default
0.5 = even split. Issue #28 (2026-05-22): <C-w>=
resets every ratio to 0.5; <C-w>+ / <C-w>- nudge
the nearest HorizontalSplit ancestor’s ratio.
Fields
VerticalSplit
Two panes side by side left + right (a vertical cut).
ratio is the left child’s share of the total width.
<C-w>> / <C-w>< nudge the nearest VerticalSplit
ancestor’s ratio.
Implementations§
Source§impl PaneNode
impl PaneNode
Sourcepub fn leaf(idx: usize) -> Self
pub fn leaf(idx: usize) -> Self
Leaf-only constructor used at App init when there’s exactly one pane.
Sourcepub fn is_single_leaf(&self) -> bool
pub fn is_single_leaf(&self) -> bool
True for the trivial single-leaf tree.
Sourcepub fn for_each_leaf(&self, visit: &mut impl FnMut(usize))
pub fn for_each_leaf(&self, visit: &mut impl FnMut(usize))
Walk the tree depth-first and call visit on every leaf
index, in left-to-right / top-to-bottom order.