feat: close results pane if find_in_files mode is cancelled

This commit is contained in:
CJ van den Berg 2025-03-26 12:21:54 +01:00
parent 3e8faabd9d
commit b410687339
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 8 additions and 1 deletions

View file

@ -387,7 +387,7 @@
["f15", "goto_prev_match"],
["f9", "theme_prev"],
["f10", "theme_next"],
["escape", "exit_mini_mode"],
["escape", "mini_mode_cancel"],
["enter", "mini_mode_select"],
["backspace", "mini_mode_delete_backwards"]
]

View file

@ -597,6 +597,12 @@ const cmds = struct {
}
pub const show_inspector_view_meta: Meta = .{};
pub fn close_find_in_files_results(self: *Self, _: Ctx) Result {
if (self.file_list_type == .find_in_files and self.is_panel_view_showing(filelist_view))
try self.toggle_panel_view(filelist_view, false);
}
pub const close_find_in_files_results_meta: Meta = .{ .description = "Close find in files results view" };
pub fn jump_back(self: *Self, _: Ctx) Result {
try self.location_history_.back(location_jump);
}

View file

@ -100,6 +100,7 @@ const cmds = struct {
pub const mini_mode_reset_meta: Meta = .{ .description = "Clear input" };
pub fn mini_mode_cancel(_: *Self, _: Ctx) Result {
command.executeName("close_find_in_files_results", .{}) catch {};
command.executeName("exit_mini_mode", .{}) catch {};
}
pub const mini_mode_cancel_meta: Meta = .{ .description = "Cancel input" };