summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 19:20:19 -0300
committerGabriel Schneider <[email protected]>2026-10-01 19:57:27 -0300
commit2868516c215a96d9e1e933ded7ac5744ec16c368 (patch)
treef4283b58044fc0b2155f1a0526a87357b0ca62cc /src/exec.zig
parent5f41a03fdcf0eaa3c1917e0f94243878c481cf8b (diff)
downloadpardes-2868516c215a96d9e1e933ded7ac5744ec16c368.tar.gz
pardes-2868516c215a96d9e1e933ded7ac5744ec16c368.zip
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 <[email protected]>
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 4bdb2584..1ee57520 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -953,7 +953,6 @@ pub const acme_words = [_]struct { acme: []const u8, pardes: ?[]const u8, hint:
.{ .acme = "Load", .pardes = "Restore" },
.{ .acme = "ID", .pardes = null },
.{ .acme = "Send", .pardes = null },
- .{ .acme = "Tab", .pardes = null },
.{ .acme = "Indent", .pardes = null, .hint = ": Enter, o and O keep the indent always" },
.{ .acme = "Local", .pardes = null },
.{ .acme = "Abort", .pardes = null, .hint = ": a debugging word that crashes acme" },
@@ -1120,6 +1119,13 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]
}
if (!p.settings.apply(setting, want)) p.reportFailure(p.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?);
},
+ // Bare, it says the width, as acme's Tab does.
+ .tab => if (arg == null) {
+ var said: [32]u8 = undefined;
+ return p.setMessage(p.active, std.fmt.bufPrint(&said, "Tab {d}", .{p.settings.tab}) catch "Tab");
+ } else if (!p.settings.apply(setting, arg)) {
+ p.reportFailure(p.active, "Tab: takes " ++ comptime config.Runtime.takes(.tab).?);
+ },
// Said with what it takes: its words, its range.
else => if (!p.settings.apply(setting, arg)) {
var text: [160]u8 = undefined;
@@ -1133,7 +1139,7 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]
if (pane.file) |*file| file.syntax_dirty = true;
}
}
- if (p.settings.tree_context_tag_style != previous_context_style) {
+ if (p.settings.tree_context_tag_style != previous_context_style or setting.action == .tab) {
for (p.panes, 0..) |slot, id| {
p.surface.body_layers[id].rows = 0;
const pane = slot orelse continue;