From 2868516c215a96d9e1e933ded7ac5744ec16c368 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 19:20:19 -0300 Subject: Tab N sets a tab's width in cells, 1 through 16, in every pane, drawn and counted (wrapping, clicks, the cursor); bare Tab says it; the ctl read and a Dump keep it A session setting, not acme's per window: the width is read by File's pure width functions (~130 callers that are given no pane), so it is one value, config.tab_now, that Runtime.apply sets and a new session resets. A file:L:C column counts runes, as compilers do, and never depended on it. Co-Authored-By: Claude Opus 5.5 --- src/File.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/File.zig') diff --git a/src/File.zig b/src/File.zig index eb11b0e4..3ef1593d 100644 --- a/src/File.zig +++ b/src/File.zig @@ -311,7 +311,7 @@ test "stacked location metadata requires matching adjacent preview ownership" { } pub fn graphemeDisplayWidth(grapheme: []const u8) usize { - if (std.mem.eql(u8, grapheme, "\t")) return config.tab_width; + if (std.mem.eql(u8, grapheme, "\t")) return config.tab_now; if (grapheme.len == 1 and grapheme[0] >= 0x20 and grapheme[0] < 0x7f) return 1; if (std.unicode.utf8ValidateSlice(grapheme)) return @max(1, @as(usize, vaxis.gwidth.gwidth(grapheme, .unicode))); // vaxis's gwidth counts back a replacement rune's 3 bytes over the one @@ -346,7 +346,7 @@ test "an invalid byte in a grapheme is one cell, and never reaches vaxis's width } pub fn byteDisplayWidth(byte: u8) usize { - return if (byte == '\t') config.tab_width else 1; + return if (byte == '\t') config.tab_now else 1; } pub fn displayWidth(text: []const u8) usize { @@ -503,7 +503,7 @@ pub fn renderedLineDisplayCol(pane: *const Pane, row: i32, line_text: []const u8 test "the ASCII arm of graphemeDisplayWidth matches the gwidth it skips" { const ref = struct { fn width(grapheme: []const u8) usize { - if (std.mem.eql(u8, grapheme, "\t")) return config.tab_width; + if (std.mem.eql(u8, grapheme, "\t")) return config.tab_now; return @max(1, @as(usize, vaxis.gwidth.gwidth(grapheme, .unicode))); } }.width; -- cgit v1.3