Skip to main content

render_with

Function render_with 

Source
pub fn render_with(
    doc: &Doc,
    editing: Editing<'_>,
    window: &mut Window,
    cx: &mut App,
) -> AnyElement
Expand description

Render a document with a caret and a selection in it.

Both are paint-time concerns and nothing else: they read their positions off the shaped text’s own layout handle, the same way the inline-code wash does, so nothing about layout depends on where the caret sits. An editor supplies the selection and owns the focus and the keys; painting a caret and a few quads is not worth a second renderer.