fix: workaround indent size limitation in indent_cursor

This commit is contained in:
CJ van den Berg 2024-10-10 23:44:13 +02:00
parent d2238bf847
commit 39d4197a42
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -2542,7 +2542,7 @@ pub const Editor = struct {
pub const toggle_comment_meta = .{ .description = "Toggle comment" }; pub const toggle_comment_meta = .{ .description = "Toggle comment" };
fn indent_cursor(self: *Self, root: Buffer.Root, cursor: Cursor, allocator: Allocator) error{Stop}!Buffer.Root { fn indent_cursor(self: *Self, root: Buffer.Root, cursor: Cursor, allocator: Allocator) error{Stop}!Buffer.Root {
const space = " "; const space = " ";
var cursel: CurSel = .{}; var cursel: CurSel = .{};
cursel.cursor = cursor; cursel.cursor = cursor;
const cols = self.indent_size - find_first_non_ws(root, cursel.cursor.row, self.metrics) % self.indent_size; const cols = self.indent_size - find_first_non_ws(root, cursel.cursor.row, self.metrics) % self.indent_size;