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:
parent
4037d67fe9
commit
80002e4d6b
2 changed files with 34 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue