Skip to main content

insert_at_visual

Function insert_at_visual 

Source
pub fn insert_at_visual(
    raw: &str,
    visual_pos: usize,
    insert: &str,
) -> (String, usize)
Expand description

Insert a (pre-escaped) string at the given visual position in the raw text. Returns the new raw string and the new visual cursor position after insertion. Enters empty style tags at the cursor boundary so typed text goes inside them.