From 0bef3ce2e18296b9d4364df53c239e2c71d34211 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 3 Nov 2025 22:43:25 +0100 Subject: [PATCH] fix: do not indent blank lines --- src/tui/editor.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 71e1b79..394dd91 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -3759,6 +3759,8 @@ pub const Editor = struct { var cursel: CurSel = .{}; cursel.cursor = cursor; try move_cursor_begin(root, &cursel.cursor, self.metrics); + if (root.line_width(cursel.cursor.row, self.metrics) catch 0 == 0) + return root; switch (self.indent_mode) { .spaces, .auto => { const cols = self.indent_size - find_first_non_ws(root, cursel.cursor.row, self.metrics) % self.indent_size;