vimsheet.controller.edit_handler

Unified line editor — vi-style editing shared by cells, commands, search.

The editor owns the buffer, the insert/normal sub-modes and the vi motions. Mode-specific behaviour is delegated to an EditorContext (see editor_context.py):

  • cell content — \, =, <, >, |, A, I, C, S, r, cw, cc, e, E,

  • colon commands — :,

  • search prompts — / and ?.

Esc in the insert sub-mode drops back to the normal sub-mode. From the normal sub-mode, Enter commits and Esc either commits (cells) or cancels (commands/search) — see EditorContext.normal_escape.

class vimsheet.controller.edit_handler.EditHandler(app)[source]

Bases: object

Handles all key events while the unified line editor is active.

Parameters:

app (VimSheetApp)

__init__(app)[source]
Parameters:

app (VimSheetApp)

Return type:

None

enter(*, start_sub='normal', cursor='end', prefill=None, align=None, intent='value', auto_move=False, move=(0, 0))[source]

Enter the editor on the current cell (see CellEditContext).

Parameters:
Return type:

None

enter_context(context, *, start_sub='normal', cursor='end')[source]

Enter the editor with an arbitrary context.

cursor is "end", "start" or "start_formula" (start, but after a leading =).

Parameters:
  • context (EditorContext)

  • start_sub (str)

  • cursor (str)

Return type:

None

handle(key)[source]
Parameters:

key (str)

Return type:

None