Skip to main content

Module preview_view

Module preview_view 

Source
Expand description

Preview pane renderer: renders parsed markdown in the diff area.

Mermaid diagrams rendered as inline images by writing terminal-specific escape sequences (iTerm2 OSC 1337, Kitty graphics protocol) directly to stdout after ratatui’s buffer flush. This bypasses ratatui’s buffer system which cannot represent image protocol data.

Structs§

PendingImage
Info about where an image should be rendered (collected during layout, written to stdout after ratatui flushes).

Functions§

clear_stale_images
Clear any stale inline images by overwriting all cells. Call when previous frame had images but current frame does not.
flush_images
Write pending images to stdout using the appropriate terminal protocol. Call this AFTER terminal.draw() so ratatui’s buffer has already been flushed. had_images_last_frame: if true and images is empty, clears stale images.
is_current_file_markdown
render_preview
Render markdown preview. Returns pending images that need to be written to stdout AFTER terminal.draw() completes.