fix: add back async commands

This commit is contained in:
CJ van den Berg 2024-11-19 21:57:43 +01:00
parent dc914ba562
commit fdf0c7ada9
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 10 additions and 2 deletions

View file

@ -52,8 +52,8 @@
["ctrl+shift+q", "quit_without_saving"], ["ctrl+shift+q", "quit_without_saving"],
["ctrl+shift+w", "close_file_without_saving"], ["ctrl+shift+w", "close_file_without_saving"],
["ctrl+shift+f", "find_in_files"], ["ctrl+shift+f", "find_in_files"],
["ctrl+shift+l", "add_cursor_all_matches_async"], ["ctrl+shift+l", "run_async", "add_cursor_all_matches"],
["ctrl+shift+i", "toggle_inspector_view_async"], ["ctrl+shift+i", "run_async", "toggle_inspector_view"],
["ctrl+shift+m", "show_diagnostics"], ["ctrl+shift+m", "show_diagnostics"],
["ctrl+shift+enter", "smart_insert_line_before"], ["ctrl+shift+enter", "smart_insert_line_before"],
["ctrl+shift+end", "select_buffer_end"], ["ctrl+shift+end", "select_buffer_end"],

View file

@ -816,6 +816,14 @@ const cmds = struct {
self.logger.print("restart flow to use changed key bindings", .{}); self.logger.print("restart flow to use changed key bindings", .{});
} }
pub const open_keybind_config_meta = .{ .description = "Edit key bindings" }; pub const open_keybind_config_meta = .{ .description = "Edit key bindings" };
pub fn run_async(_: *Self, ctx: Ctx) Result {
var cmd: []const u8 = undefined;
if (!try ctx.args.match(.{tp.extract(&cmd)}))
return tp.exit_error(error.InvalidArgument, null);
try tp.self_pid().send(.{ "cmd", cmd, .{} });
}
pub const run_async_meta = .{ .interactive = false };
}; };
pub const MiniMode = struct { pub const MiniMode = struct {