feat: open_file in split with shift+enter

This commit is contained in:
CJ van den Berg 2026-01-14 21:39:34 +01:00
parent 43dca7e2e8
commit 65f65842a2
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -47,10 +47,14 @@ pub fn select(self: *Type) void {
var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);
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))
tp.self_pid().send(.{ "cmd", "change_project", .{file_path} }) catch {}
else if (file_path.len > 0)
tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_path } }) catch {};
tp.self_pid().send(.{ "cmd", cmd_, .{ .file = file_path } }) catch {};
}
command.executeName("exit_mini_mode", .{}) catch {};
}