vimsheet.model.undo
Command-pattern undo/redo stack for VimSheet.
- class vimsheet.model.undo.YankedCell(value, formula, fmt=None, locked=False, comment=None)[source]
Bases:
objectRegister entry that preserves both a cell’s formula and its value.
- Parameters:
value (Any)
formula (str | None)
fmt (CellFormat | None)
locked (bool)
comment (str | None)
- fmt: CellFormat | None = None
- class vimsheet.model.undo.SetCellCommand(sheet, row, col, new_value, new_formula=None)[source]
Bases:
Command
- class vimsheet.model.undo.DeleteRangeCommand(sheet, cell_range)[source]
Bases:
Command
- class vimsheet.model.undo.ValidationCommand(sheet, row, col, new_rule)[source]
Bases:
CommandSet or clear a validation rule on a single cell, undoable.
- class vimsheet.model.undo.SortRangeCommand(sheet, r1, c1, sorted_data)[source]
Bases:
CommandSnapshot a range before sorting, allow undo/redo.
- class vimsheet.model.undo.FillRangeCommand(sheet, updates)[source]
Bases:
Command
- class vimsheet.model.undo.PasteCommand(sheet, base_row, base_col, data)[source]
Bases:
Command
- class vimsheet.model.undo.LockCommand(sheet, row, col, locked)[source]
Bases:
Command
- class vimsheet.model.undo.FormatCommand(sheet, row, col, **new_fmt_kwargs)[source]
Bases:
Command
- class vimsheet.model.undo.SortCommand(sheet, sort_keys, range_bounds=None)[source]
Bases:
Command- Parameters:
- class vimsheet.model.undo.ShiftCellsCommand(sheet, src, dr, dc)[source]
Bases:
CommandCascade-shift a cell block one step in direction (dr, dc).
The entire strip from the source’s leading edge to the end of used data shifts by one, so existing content is pushed out of the way rather than overwritten. The vacated leading edge is left empty.
- class vimsheet.model.undo.UndoStack(max_size=1000)[source]
Bases:
objectManages the undo/redo history for a sheet.
- Parameters:
max_size (int)
- push(cmd)[source]
Execute cmd and push it onto the undo stack, clearing redo history.
- Parameters:
cmd (Command)
- Return type:
None