feat: add set_buffer_tab_width and set_session_tab_width commands

Also, fold the tab_width and set_tab_width commands into one. The default
command (set_tab_width) now stores the tab_width in the persistent config.
This commit is contained in:
CJ van den Berg 2025-08-12 12:54:34 +02:00
parent 4037d67fe9
commit 80002e4d6b
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 34 additions and 5 deletions

View file

@ -711,14 +711,14 @@ pub const Editor = struct {
}
}
pub fn set_tab_width(self: *Self, ctx: Context) Result {
pub fn set_editor_tab_width(self: *Self, ctx: Context) Result {
var tab_width: usize = 0;
if (!try ctx.args.match(.{tp.extract(&tab_width)}))
return error.InvalidSetTabWidthArgument;
self.tab_width = tab_width;
self.refresh_tab_width();
}
pub const set_tab_width_meta: Meta = .{ .arguments = &.{.integer} };
pub const set_editor_tab_width_meta: Meta = .{ .arguments = &.{.integer} };
fn close(self: *Self) !void {
var meta = std.ArrayListUnmanaged(u8).empty;