Skip to main content

Module marks

Module marks 

Source
Expand description

Pure helpers for marks (m<x> / '<x>) and previous-position swap (^X^X).

Marks are session-local: a HashMap<char, (usize, usize)> owned by app::run. Previous-position is a single Option<(usize, usize)> slot also owned by app::run.

Enums§

MarkTarget
Result of a mark jump or previous-position swap. The caller (app dispatch) handles OtherFile by switching files before applying the line jump.

Functions§

is_valid_mark_name
True iff c is a valid mark name (ASCII lowercase letter or ASCII digit).
jump_previous
Swap current position with the previous-position slot. Returns the previous position as a MarkTarget, or None if no previous position has been recorded.
mark_jump
Jump to mark name. Returns a MarkTarget describing the destination, or None if the mark is unknown / name is invalid. On a successful jump, records (current_file_index, current_top) into previous_position.
mark_set
Set mark name to (file_index, top_line). Silently no-ops on invalid mark names.
update_prev_position
Helper for big-jump dispatch sites: record the current position as the previous position before performing a discontinuous move.