euporie.core.widgets.toc

Define a table-of-contents display widget.

Functions

NamedTuple(typename[, fields])

Typed version of namedtuple.

get_app()

Get the current active (running) Application.

wrap(text[, width])

Wrap a single paragraph of text, returning a list of wrapped lines.

Classes

Border(body, border, style, str] =, ...)

Draw a border around any container.

BufferControl([buffer, input_processors, ...])

Control for visualizing the content of a Buffer.

Dropdown(options[, labels, index, indices, ...])

A dropdown widget, allowing selection of an item from a menu of options.

FastDictCache(get_value[, size])

Fast, lightweight cache which keeps at most size items.

HSplit(children[, window_too_small, align, ...])

Several layouts, one stacked above/under the other.

MarginContainer(margin, target)

A container which renders a stand-alone margin.

MouseButton(*values)

MouseEventType(*values)

Point(x, y)

ScrollbarMargin([display_arrows, ...])

Margin displaying a scrollbar.

SelectionState([original_cursor_position, type])

State of the current selection.

SimpleCache([maxsize])

Thread safe version of :py:`SimpleCache`.

TableOfContents()

A table of contents widget, which allows switching between TOC types.

TocControl([kind])

A control to render the current tab's table of contents.

TocEntry(level, text, token, lines, window)

Entry for tab table of contents.

UIContent(get_line, StyleAndTextTuples] = >, ...)

Content generated by a user control.

UIControl()

Base class for all user interface controls.

VSplit(children[, window_too_small, align, ...])

Several layouts, one stacked left/right of the other.

WeakKeyDictionary([dict])

Mapping class that references keys weakly.

Window(*args, **kwargs)

Container that holds a control.

class euporie.core.widgets.toc.TableOfContents

Bases: object

A table of contents widget, which allows switching between TOC types.

class euporie.core.widgets.toc.TocControl(kind: str = 'contents')

Bases: UIControl

A control to render the current tab’s table of contents.

  • Get list of current windows

  • store buffer -> window map

  • Retrieve entries for each buffer from entry cache

  • When buffer content changes, update entry list in cache

create_content(width: int, height: int) UIContent

Generate the content for this user control.

get_invalidate_events() Iterable[Event[object]]

Return a list of Event objects.

get_key_bindings() KeyBindingsBase | None

Key bindings that are specific for this user control.

is_focusable() bool

Tell whether this user control is focusable.

mouse_handler(mouse_event: MouseEvent) NotImplementedOrNone

Handle mouse events.

move_cursor_down() None

Request to move the cursor down.

move_cursor_up() None

Request to move the cursor up.

preferred_height(width: int, max_available_height: int, wrap_lines: bool, get_line_prefix: GetLinePrefixCallable | None) int | None

Use all available height.

preferred_width(max_available_width: int) int | None

Use all available width.

reset() None

Reset the control.

class euporie.core.widgets.toc.TocEntry(level: int, text: str, token: str, lines: slice, window: Window)

Bases: NamedTuple

Entry for tab table of contents.

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

level: int

Alias for field number 0

lines: slice

Alias for field number 3

text: str

Alias for field number 1

token: str

Alias for field number 2

window: Window

Alias for field number 4