class

Anvil::InlineRenderer

Inherits Termisu::Renderer < Reference < Object

Übersetzt die absoluten Pufferkoordinaten, die Termisu::Buffer#render_to liefert, in Bewegungen innerhalb einer Region, deren obere Kante irgendwo im Scrollback steht.

Vertikal muss relativ adressiert werden (CUU/CUD): die absolute Bildschirmzeile der Region ist unbekannt und ändert sich bei jedem Scroll. Horizontal geht absolut (CHA) — die Region beginnt immer in Spalte 0 und ist so breit wie das Terminal, das spart die gesamte Spaltenbuchhaltung.

Schreibt in ein IO, nicht in ein Terminal: so lässt sich eine Region in einen Speicherpuffer rendern und prüfen, ohne ein echtes Terminal zu brauchen.

Constructors

new(io : IO, width : Int32, height : Int32)
Source

Instance methods

apply_sgr(fg : Termisu::Color, bg : Termisu::Color, attr : Termisu::Attribute, old_fg : Termisu::Color | Nil, old_bg : Termisu::Color | Nil, old_attr : Termisu::Attribute) : Nil

Applies a complete style transition (attributes + colors) in one call.

fg, bg, and attr are the target style. The old_ parameters carry the caller's view of the current terminal style (nil = unknown, which forces emission).

This default implementation decomposes the transition into the granular color/attribute methods above with the legacy emission semantics (reset-then-reapply when any attribute is removed), so existing renderer implementations need no changes. Terminal overrides this to emit a single combined SGR sequence per transition instead.

The branch count is a flat per-attribute dispatch table, not nested logic. ameba:disable Metrics/CyclomaticComplexity

Source
background=(color : Termisu::Color)

Sets the background color (writes escape sequence).

Source
close

Closes the renderer and releases resources.

Source
enable_bold

Enables bold text (writes escape sequence).

Source
enable_cursive

Enables italic/cursive text (writes escape sequence).

Source
enable_dim

Enables dim/faint text (writes escape sequence).

Source
enable_hidden

Enables hidden/invisible text (writes escape sequence).

Source
enable_italic
Source
enable_reverse

Enables reverse video (writes escape sequence).

Source
enable_strikethrough

Enables strikethrough text (writes escape sequence).

Source
enable_underline

Enables underline text (writes escape sequence).

Source
flush

Flushes any buffered output.

Source
foreground=(color : Termisu::Color)

Sets the foreground color (writes escape sequence).

Source
height
Source
height=(height : Int32)
Source
hide_cursor

Writes hide cursor escape sequence.

Source
move_cursor(x : Int32, y : Int32)

Moves cursor to the specified position (writes escape sequence).

Source
move_to_row(y : Int32) : Nil
Source
reset_attributes

Resets all text attributes to default (writes escape sequence).

Source
row

Wo der Cursor steht, in Regionszeilen ab 0. Die Surface hält ihn zwischen den Frames auf Zeile 0.

Source
row=(row : Int32)

Wo der Cursor steht, in Regionszeilen ab 0. Die Surface hält ihn zwischen den Frames auf Zeile 0.

Source
show_cursor

Writes show cursor escape sequence.

Source
size

Returns the renderer dimensions as {width, height}.

Source
width
Source
width=(width : Int32)
Source
write(data : String, columns_advanced = 0)

Writes data to the renderer.

Source
write(data : Bytes, columns_advanced = 0)

Writes raw bytes to the renderer.

Default implementation delegates to the String overload so existing renderer implementations work unchanged. Terminal overrides this to stream the bytes to the backend without materializing a String.

Source