pub struct GoalCol {
pub goal_col: ColIdx,
}Expand description
A small helper for “preferred column” behavior (vim-like vertical motion).
When you move up/down, you usually want to keep the goal column even if a particular line is shorter. Store the goal separately from the actual column.
Typical usage:
- Update
goal_colwhen moving left/right or after inserting text. - When moving up/down, clamp to the target line length, but keep
goal_col.
Fields§
§goal_col: ColIdxImplementations§
Trait Implementations§
impl Copy for GoalCol
impl Eq for GoalCol
impl StructuralPartialEq for GoalCol
Auto Trait Implementations§
impl Freeze for GoalCol
impl RefUnwindSafe for GoalCol
impl Send for GoalCol
impl Sync for GoalCol
impl Unpin for GoalCol
impl UnsafeUnpin for GoalCol
impl UnwindSafe for GoalCol
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