fix: improve movement of tabs

This switches to movement semantics for tab dragging and moving.
Previously we switched tabs, which was confusing and a little buggy.

closes #459
This commit is contained in:
CJ van den Berg 2026-01-19 22:45:38 +01:00
parent 6ac7cc5b5c
commit 768032d3ea
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 90 additions and 86 deletions

View file

@ -1470,17 +1470,6 @@ const cmds = struct {
}
pub const move_tab_previous_meta: Meta = .{ .description = "Move tab to previous position" };
pub fn swap_tabs(self: *Self, ctx: Ctx) Result {
var buffer_ref_a: usize = undefined;
var buffer_ref_b: usize = undefined;
if (!try ctx.args.match(.{
tp.extract(&buffer_ref_a),
tp.extract(&buffer_ref_b),
})) return error.InvalidSwapTabsArgument;
_ = try self.widgets_widget.msg(.{ "swap_tabs", buffer_ref_a, buffer_ref_b });
}
pub const swap_tabs_meta: Meta = .{ .arguments = &.{ .integer, .integer } };
pub fn place_next_tab(self: *Self, ctx: Ctx) Result {
var pos: enum { before, after } = undefined;
var buffer_ref: usize = undefined;