Where the caret is, as a zero-based line and a byte column within it.
- edit: the text being edited.
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "ab\ncd");
move_caret(*edit, 4);
line, column := caret_position(*edit);
assert(line == 1 && column == 1);caret_position :: (edit: *Text_Edit) -> (line: int, column: int)
Where the caret is, as a zero-based line and a byte column within it.
Parameters
- edit: *Text_Edit
- the text being edited.
Returns
- line: int
- column: int
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "ab\ncd");
move_caret(*edit, 4);
line, column := caret_position(*edit);
assert(line == 1 && column == 1);