Compare commits

..

No commits in common. "65f65842a2a9bfdba1bdc9362962900aab986c34" and "bfefe2f99d5d42a1919c798ce0e2f5832cdacc9a" have entirely different histories.

3 changed files with 1 additions and 19 deletions

View file

@ -487,7 +487,6 @@
["tab", "mini_mode_try_complete_file"], ["tab", "mini_mode_try_complete_file"],
["escape", "mini_mode_cancel"], ["escape", "mini_mode_cancel"],
["enter", "mini_mode_select"], ["enter", "mini_mode_select"],
["shift+enter", "mini_mode_select_alternate"],
["backspace", "mini_mode_delete_backwards"] ["backspace", "mini_mode_delete_backwards"]
] ]
}, },

View file

@ -17,11 +17,6 @@ const MessageFilter = @import("../../MessageFilter.zig");
const max_complete_paths = 1024; const max_complete_paths = 1024;
pub const SelectMode = enum {
normal,
alternate,
};
pub fn Create(options: type) type { pub fn Create(options: type) type {
return struct { return struct {
allocator: std.mem.Allocator, allocator: std.mem.Allocator,
@ -33,7 +28,6 @@ pub fn Create(options: type) type {
complete_trigger_count: usize = 0, complete_trigger_count: usize = 0,
total_matches: usize = 0, total_matches: usize = 0,
matched_entry: usize = 0, matched_entry: usize = 0,
select: SelectMode = .normal,
commands: Commands = undefined, commands: Commands = undefined,
const Commands = command.Collection(cmds); const Commands = command.Collection(cmds);
@ -378,13 +372,6 @@ pub fn Create(options: type) type {
} }
pub const mini_mode_select_meta: Meta = .{ .description = "Select" }; pub const mini_mode_select_meta: Meta = .{ .description = "Select" };
pub fn mini_mode_select_alternate(self: *Self, _: Ctx) Result {
self.select = .alternate;
options.select(self);
self.update_mini_mode_text();
}
pub const mini_mode_select_alternate_meta: Meta = .{ .description = "Select alternate" };
pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result { pub fn mini_mode_paste(self: *Self, ctx: Ctx) Result {
return mini_mode_insert_bytes(self, ctx); return mini_mode_insert_bytes(self, ctx);
} }

View file

@ -47,14 +47,10 @@ pub fn select(self: *Type) void {
var buf: std.ArrayList(u8) = .empty; var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator); defer buf.deinit(self.allocator);
const file_path = project_manager.expand_home(self.allocator, &buf, self.file_path.items); const file_path = project_manager.expand_home(self.allocator, &buf, self.file_path.items);
const cmd_ = switch (self.select) {
.normal => "navigate",
.alternate => "navigate_split_vertical",
};
if (root.is_directory(file_path)) if (root.is_directory(file_path))
tp.self_pid().send(.{ "cmd", "change_project", .{file_path} }) catch {} tp.self_pid().send(.{ "cmd", "change_project", .{file_path} }) catch {}
else if (file_path.len > 0) else if (file_path.len > 0)
tp.self_pid().send(.{ "cmd", cmd_, .{ .file = file_path } }) catch {}; tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_path } }) catch {};
} }
command.executeName("exit_mini_mode", .{}) catch {}; command.executeName("exit_mini_mode", .{}) catch {};
} }