vimsheet.ui.status_bar

Status bar widget — mode, position, stats, file status, clock.

class vimsheet.ui.status_bar.MessageEntry(text, timestamp, level)[source]

Bases: object

A single status bar message stored in history.

Parameters:
text: str
timestamp: float
level: str
__init__(text, timestamp, level)
Parameters:
Return type:

None

class vimsheet.ui.status_bar.StatusBar(*args, **kwargs)[source]

Bases: Widget

Bottom status bar displaying context-sensitive information.

Parameters:
  • args (Any)

  • kwargs (Any)

DEFAULT_CSS = '\n    StatusBar {\n        height: 1;\n        layout: horizontal;\n        background: $surface;\n        color: $text;\n    }\n    StatusBar .segment {\n        padding: 0 1;\n        content-align: left middle;\n    }\n    StatusBar #status-mode {\n        width: 10;\n        background: $primary;\n        content-align: center middle;\n        text-style: bold;\n    }\n    StatusBar #status-sheet {\n        width: 16;\n        background: $primary-darken-1;\n        text-style: bold;\n    }\n    StatusBar #status-pos {\n        width: 14;\n    }\n    StatusBar #status-stats {\n        width: 12;\n    }\n    StatusBar #status-message {\n        width: 1fr;\n        color: $text-warning;\n    }\n    StatusBar #status-file-state {\n        width: 10;\n    }\n    StatusBar #status-filename {\n        width: 24;\n    }\n    StatusBar #status-clock {\n        width: 10;\n    }\n    '

Default TCSS.

mode: reactive[Mode]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

sheet_name: reactive[str]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

cell_address: reactive[str]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

row: reactive[int]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

col: reactive[int]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

used_rows: reactive[int]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

filename: reactive[str]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

file_modified: reactive[bool]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

message: reactive[str]

Create a reactive attribute.

Parameters:
  • default – A default value or callable that returns a default.

  • layout – Perform a layout on change.

  • repaint – Perform a repaint on change.

  • init – Call watchers on initialize (post mount).

  • always_update – Call watchers even when the new value equals the old value.

  • recompose – Compose the widget again when the attribute changes.

  • bindings – Refresh bindings when the reactive changes.

  • toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.

__init__(*args, **kwargs)[source]

Initialize a Widget.

Parameters:
  • *children – Child widgets.

  • name – The name of the widget.

  • id – The ID of the widget in the DOM.

  • classes – The CSS classes for the widget.

  • disabled – Whether the widget is disabled or not.

  • markup – Enable content markup?

  • args (Any)

  • kwargs (Any)

Return type:

None

message_history: deque[MessageEntry]
set_history_size(size)[source]

Change the max length of the message history deque.

Parameters:

size (int)

Return type:

None

compose()[source]

Lay out status segments.

Return type:

Iterable[Widget]

on_mount()[source]

Start the clock timer.

Return type:

None

watch_mode(value)[source]

Update mode label.

Parameters:

value (Mode)

Return type:

None

watch_sheet_name(value)[source]
Parameters:

value (str)

Return type:

None

watch_cell_address(value)[source]

Update cell address label.

Parameters:

value (str)

Return type:

None

watch_row(_value)[source]
Parameters:

_value (int)

Return type:

None

watch_col(_value)[source]
Parameters:

_value (int)

Return type:

None

watch_used_rows(value)[source]

Update stats label.

Parameters:

value (int)

Return type:

None

watch_filename(value)[source]

Update filename label.

Parameters:

value (str)

Return type:

None

watch_file_modified(value)[source]

Update file-state label.

Parameters:

value (bool)

Return type:

None

watch_message(value)[source]

Update transient message label.

Parameters:

value (str)

Return type:

None

show_message(text, duration=3.0, priority=3, level=None)[source]

Show a transient message.

Skipped if a higher-priority message is currently displayed.

level is "info", "error", or "success" — controls the display colour and is stored in the message history.

If level is None (default), it is auto-detected from the message text using keyword matching.

Parameters:
Return type:

None

set_persistent_message(text, priority=2)[source]

Show a message with no auto-clear timer (for prompts).

Skipped if a higher-priority message is currently displayed. Pass empty string + appropriate priority to clear.

Parameters:
Return type:

None

update_cursor(row, col, address)[source]

Convenience method to update all cursor-position fields.

Parameters:
Return type:

None

can_focus = False

Widget may receive focus.

can_focus_children = True

Widget’s children may receive focus.