fix: move a cursor at the beginning of a line that is being indented

This commit is contained in:
CJ van den Berg 2024-12-06 21:20:04 +01:00
parent c282398d6e
commit d26d830246
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -2575,7 +2575,7 @@ pub const Editor = struct {
var cursel: CurSel = .{};
cursel.cursor = cursor;
const cols = self.indent_size - find_first_non_ws(root, cursel.cursor.row, self.metrics) % self.indent_size;
try smart_move_cursor_begin(root, &cursel.cursor, self.metrics);
try move_cursor_begin(root, &cursel.cursor, self.metrics);
return self.insert(root, &cursel, space[0..cols], allocator) catch return error.Stop;
}