pub struct ChangeBank {
pub last_edit: Option<(usize, usize)>,
pub list: Vec<(usize, usize)>,
pub cursor: Option<usize>,
}Expand description
Per-buffer changelist bank: g;/g, history plus the '. / `.
“last change” mark. Shared via Arc<Mutex<ChangeBank>> across every
window’s Editor viewing the SAME buffer — vim’s changelist and
last-change mark are per-buffer, not per-window, so an edit made in one
split must be visible to g; / `. from any other split on that
buffer (audit B3).
UNLIKE GlobalMarks / [Registers] / SearchBank / abbrevs /
last-substitute — which are each a single Arc shared by literally
every Editor in the app, session-global — a ChangeBank is
per-buffer: the app layer keys a bank per buffer_id and hands each
Editor the Arc for its CURRENT buffer, swapping it whenever the
editor’s buffer changes (see App::change_bank_for /
Editor::set_change_bank_arc). Two editors on the same buffer_id share
one bank; editors on different buffers never see each other’s entries.
Fields§
§last_edit: Option<(usize, usize)>Position of the most recent buffer mutation, matching vim’s :h '.
(“the position where the last change was made” — change-start, not
the post-edit cursor). Surfaced via the '. / `. marks.
list: Vec<(usize, usize)>Bounded ring of recent edit positions (newest at back). g; walks
toward older, g, toward newer. Capped at
crate::types::CHANGE_LIST_MAX.
cursor: Option<usize>Index into list while walking; None outside a walk (any new
edit clears it and trims forward entries).
Trait Implementations§
Source§impl Clone for ChangeBank
impl Clone for ChangeBank
Source§fn clone(&self) -> ChangeBank
fn clone(&self) -> ChangeBank
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more