fix: entering the same minimode twice causes an empty keybind set

This commit is contained in:
CJ van den Berg 2025-08-15 11:22:43 +02:00
parent 62b8493b93
commit 6b04f4db08
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1036,10 +1036,10 @@ const cmds = struct {
fn enter_mini_mode(self: *Self, comptime mode: anytype, ctx: Ctx) !void { fn enter_mini_mode(self: *Self, comptime mode: anytype, ctx: Ctx) !void {
command.executeName("disable_fast_scroll", .{}) catch {}; command.executeName("disable_fast_scroll", .{}) catch {};
command.executeName("disable_jump_mode", .{}) catch {}; command.executeName("disable_jump_mode", .{}) catch {};
const input_mode_, const mini_mode_ = try mode.create(self.allocator, ctx);
if (self.mini_mode_) |_| try exit_mini_mode(self, .{}); if (self.mini_mode_) |_| try exit_mini_mode(self, .{});
if (self.input_mode_outer_) |_| try exit_overlay_mode(self, .{}); if (self.input_mode_outer_) |_| try exit_overlay_mode(self, .{});
if (self.input_mode_outer_ != null) @panic("exit_overlay_mode failed"); if (self.input_mode_outer_ != null) @panic("exit_overlay_mode failed");
const input_mode_, const mini_mode_ = try mode.create(self.allocator, ctx);
self.input_mode_outer_ = self.input_mode_; self.input_mode_outer_ = self.input_mode_;
self.input_mode_ = input_mode_; self.input_mode_ = input_mode_;
self.mini_mode_ = mini_mode_; self.mini_mode_ = mini_mode_;