Skip to main content

Module selectable

Module selectable 

Source
Expand description

Text you can select with the pointer and copy out of.

The two hard halves are already here: render_with paints a Selection it is handed, and fills a BlockLayouts whose BlockLayouts::hit turns a point back into a Cursor. What was missing is the gesture — press, drag, release — which belonged to whoever owns the selection, and until now only an editor ever did.

This is that gesture and nothing else. Which item holds the selection, and what copying means, stay the caller’s.

Enums§

Pointer
What the pointer did over the text.

Functions§

copied
The text a selection covers, as it would be pasted.
render
Render doc with selection painted in it, reporting what the pointer does.