pub enum VisualExtent {
Char {
lines: usize,
width: usize,
},
Line {
lines: usize,
},
Block {
rows: usize,
cols: usize,
to_eol: bool,
},
}Expand description
Size of a visual-mode selection, captured for LastChange::VisualOp
dot-repeat (:h v_.). Vim’s rule: characterwise replays over the same
number of lines, with the same character width on the last line;
linewise replays over the same number of lines.
Variants§
Char
Charwise (v). lines == 1: width is the raw selected char count,
and replay selects exactly width chars starting at the cursor.
lines > 1: the first replay line runs from the cursor’s column to
ITS OWN end of line, middle lines are taken whole, and the last line
takes its first width chars (measured from column 0, matching the
original selection’s last-line char count).
Line
Linewise (V). Replay is exactly [count]dd-equivalent: lines
rows starting at the cursor’s row.
Block
Blockwise (<C-v>). Replay reconstructs a rows × cols rectangle
with its TOP-LEFT corner at the cursor (:h v_. for blocks), then
re-runs the operator. to_eol preserves a $-ragged right edge
(:h v_b_$) — every row then resolves its own EOL instead of the
fixed cols width.
Trait Implementations§
Source§impl Clone for VisualExtent
impl Clone for VisualExtent
Source§fn clone(&self) -> VisualExtent
fn clone(&self) -> VisualExtent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more