vimsheet.controller.mode

Mode enum and state-machine transitions.

class vimsheet.controller.mode.Mode(*values)[source]

Bases: Enum

Application editing modes, mirroring vim modal behaviour.

NORMAL = 1
INSERT = 2
EDIT = 3
COMMAND = 4
SEARCH = 5
VISUAL = 6
VISUAL_LINE = 7
VISUAL_BLOCK = 8
label()[source]

Return the display label shown in the formula bar / status bar.

Return type:

str

css_class()[source]

Return a CSS class name for theme-dependent mode colour.

Return type:

str

is_visual()[source]

Return True for any Visual sub-mode.

Return type:

bool

vimsheet.controller.mode.can_transition(from_mode, to_mode)[source]

Return True if a direct mode transition is valid.

Parameters:
Return type:

bool