refactor: move mode.event_handler back to input mode
This commit is contained in:
parent
d06ebd0dd5
commit
525287c7ac
22 changed files with 47 additions and 51 deletions
|
@ -52,9 +52,11 @@ pub fn Create(options: type) type {
|
|||
if (@hasDecl(options, "restore_state"))
|
||||
options.restore_state(self) catch {};
|
||||
return .{
|
||||
try keybind.mode.mini.file_browser.create(allocator),
|
||||
.{
|
||||
.input_handler = keybind.mode.mini.file_browser.create(allocator),
|
||||
.event_handler = EventHandler.to_owned(self),
|
||||
},
|
||||
.{
|
||||
.name = options.name(self),
|
||||
},
|
||||
};
|
||||
|
|
|
@ -48,9 +48,11 @@ pub fn create(allocator: Allocator, _: command.Context) !struct { tui.Mode, tui.
|
|||
try self.input.appendSlice(text);
|
||||
}
|
||||
return .{
|
||||
try keybind.mode.mini.find.create(allocator),
|
||||
.{
|
||||
.input_handler = keybind.mode.mini.find.create(allocator),
|
||||
.event_handler = EventHandler.to_owned(self),
|
||||
},
|
||||
.{
|
||||
.name = name,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -42,9 +42,11 @@ pub fn create(allocator: Allocator, _: command.Context) !struct { tui.Mode, tui.
|
|||
self.input = self.buf[0..text.len];
|
||||
};
|
||||
return .{
|
||||
try keybind.mode.mini.find_in_files.create(allocator),
|
||||
.{
|
||||
.input_handler = keybind.mode.mini.find_in_files.create(allocator),
|
||||
.event_handler = EventHandler.to_owned(self),
|
||||
},
|
||||
.{
|
||||
.name = name,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -33,9 +33,11 @@ pub fn create(allocator: Allocator, _: command.Context) !struct { tui.Mode, tui.
|
|||
};
|
||||
try self.commands.init(self);
|
||||
return .{
|
||||
try keybind.mode.mini.goto.create(allocator),
|
||||
.{
|
||||
.input_handler = keybind.mode.mini.goto.create(allocator),
|
||||
.event_handler = EventHandler.to_owned(self),
|
||||
},
|
||||
.{
|
||||
.name = name,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -45,9 +45,11 @@ pub fn create(allocator: Allocator, ctx: command.Context) !struct { tui.Mode, tu
|
|||
};
|
||||
try self.commands.init(self);
|
||||
return .{
|
||||
try keybind.mode.mini.move_to_char.create(allocator),
|
||||
.{
|
||||
.input_handler = keybind.mode.mini.move_to_char.create(allocator),
|
||||
.event_handler = EventHandler.to_owned(self),
|
||||
},
|
||||
.{
|
||||
.name = self.name(),
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue