fix: do not indent blank lines

This commit is contained in:
CJ van den Berg 2025-11-03 22:43:25 +01:00
parent cd1d9f3042
commit 0bef3ce2e1
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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;