Gap cursor
Place the caret between closed blocks in a GPUI editor.
Try it
Section titled “Try it”Click halfway between the two horizontal rules. A short blue line marks the gap. Press Right Arrow to select the second rule.
Install
Section titled “Install”cargo add gpdoc-plugin-gap-cursorExample
Section titled “Example”use gpdoc_plugin_gap_cursor::{gap_cursor, paint_gap_cursor};use gpdoc_plugin_paragraph::paragraph;
let config = gpdoc::EditorConfig::builder() .plugin(paragraph()) .plugin(gap_cursor().with_view(paint_gap_cursor)) .build() .expect("configure editor");To draw a different marker, pass a painter to .with_view(...) taking Bounds<Pixels>, &mut Window, and &mut App. The plugin locates the boundary and handles keyboard and pointer navigation.
Open a document with two adjacent closed blocks, such as horizontal rules. Click their shared boundary to select the gap. In a focused editor, a short horizontal line marks the insertion point.
From a selected node, the arrow keys move to an adjacent gap. From a gap, they select the neighboring node in that direction.