Like `cursor_to_raw`, but also enters empty style tags at the boundary when the basic position lands right before one. Use this for cursor positioning and single-point insertion.
(raw: &str, visual_pos: usize)
| 2067 | /// when the basic position lands right before one. |
| 2068 | /// Use this for cursor positioning and single-point insertion. |
| 2069 | pub fn cursor_to_raw_for_insertion(raw: &str, visual_pos: usize) -> usize { |
| 2070 | let pos = cursor_to_raw(raw, visual_pos); |
| 2071 | let chars: Vec<char> = raw.chars().collect(); |
| 2072 | // If pos lands right at the start of an empty {name|} tag, enter it |
| 2073 | enter_empty_tags_at(&chars, pos) |
| 2074 | } |
| 2075 | |
| 2076 | /// Insert a (pre-escaped) string at the given visual position in the raw text. |
| 2077 | /// Returns the new raw string and the new visual cursor position after insertion. |
no test coverage detected