Expand description
Pure helpers for marks (m<x> / '<x>) and previous-position swap (^X^X).
Marks are session-local: a HashMap<char, usize> owned by app::run.
Previous-position is a single Option<usize> slot also owned by app::run.
Functionsยง
- is_
valid_ mark_ name - True iff
cis a valid mark name (ASCII lowercase letter or ASCII digit). - jump_
previous - Swap current top_line with the previous-position slot. Returns the new
top_line, or
Noneif no previous position has been recorded. - mark_
jump - Jump to mark
name. Returns the line number to jump to (clamped to[0, line_count-1]), orNoneif the mark is unknown / name is invalid / the source is empty. On a successful jump, records current top intoprevious_position. - mark_
set - Set mark
nametotop_line. Silently no-ops on invalid mark names. - update_
prev_ position - Helper for big-jump dispatch sites: record the current top_line as the previous position before performing a discontinuous move.