From cd1d9f30424b97197dfba8595a8bfd12615177ab Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 3 Nov 2025 22:37:12 +0100 Subject: [PATCH] fix: don't clip leading whitespace based on cursor column in smart_insert_line --- src/tui/editor.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index f725fce..71e1b79 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -4522,7 +4522,7 @@ pub const Editor = struct { fn cursel_smart_insert_line(self: *Self, root: Buffer.Root, cursel: *CurSel, b_allocator: std.mem.Allocator, mode: WSCollapseMode) !Buffer.Root { const row = cursel.cursor.row; - const leading_ws = @min(find_first_non_ws(root, row, self.metrics), cursel.cursor.col); + const leading_ws = find_first_non_ws(root, row, self.metrics); var sfa = std.heap.stackFallback(512, self.allocator); const sfa_allocator = sfa.get(); var stream: std.Io.Writer.Allocating = .init(sfa_allocator);