MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / visual_line_end

Function visual_line_end

src/text_input.rs:1705–1708  ·  view source on GitHub ↗

Move to end of current visual line. Returns the new global cursor position.

(visual_lines: &[VisualLine], cursor_pos: usize)

Source from the content-addressed store, hash-verified

1703
1704/// Move to end of current visual line. Returns the new global cursor position.
1705pub fn visual_line_end(visual_lines: &[VisualLine], cursor_pos: usize) -> usize {
1706 let (line, _col) = cursor_to_visual_pos(visual_lines, cursor_pos);
1707 visual_lines[line].global_char_start + visual_lines[line].char_count
1708}
1709
1710/// Find the nearest character boundary for a given pixel x-position.
1711/// `char_x_positions` has len = char_count + 1 (position 0 = left edge, position n = right edge).

Callers 1

Calls 1

cursor_to_visual_posFunction · 0.85

Tested by

no test coverage detected