vimsheet.ui.buffers_screen

Buffer list overlay — shown by :buffers / :bufs / :ls.

class vimsheet.ui.buffers_screen.BuffersScreen(buffers, active_idx)[source]

Bases: VimModalScreen

Modal overlay listing all open buffers.

Parameters:
DEFAULT_CSS = '\n    BuffersScreen {\n        align: center middle;\n    }\n    BuffersScreen > VerticalScroll {\n        width: 72%;\n        height: 60%;\n        background: $surface;\n        border: round $primary;\n        padding: 1 2;\n    }\n    BuffersScreen > VerticalScroll > Static {\n        width: auto;\n    }\n    '

Default TCSS.

__init__(buffers, active_idx)[source]

Initialize the screen.

Parameters:
  • name – The name of the screen.

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

  • classes – The CSS classes for the screen.

  • buffers (list[Workbook])

  • active_idx (int)

Return type:

None

compose()[source]

Called by Textual to create child widgets.

This method is called when a widget is mounted or by setting recompose=True when calling [refresh()][textual.widget.Widget.refresh].

Note that you don’t typically need to explicitly call this method.

Example

```python def compose(self) -> ComposeResult:

yield Header() yield Label(“Press the button below:”) yield Button() yield Footer()

```

Return type:

Iterable[Widget]

can_focus = False

Widget may receive focus.

can_focus_children = True

Widget’s children may receive focus.