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:
parent
6ac7cc5b5c
commit
768032d3ea
3 changed files with 90 additions and 86 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue