fix: expand_home when detecting file paths in selection

This commit is contained in:
CJ van den Berg 2026-02-13 23:01:15 +01:00
parent fa71704a94
commit 6f9132c3b2
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1570,7 +1570,10 @@ const cmds = struct {
pub fn open_file(self: *Self, ctx: Ctx) Result { pub fn open_file(self: *Self, ctx: Ctx) Result {
if (get_active_selection(self.allocator)) |text| { if (get_active_selection(self.allocator)) |text| {
defer self.allocator.free(text); defer self.allocator.free(text);
const link = try file_link.parse(text); var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);
const file_path = project_manager.expand_home(self.allocator, &buf, text);
const link = try file_link.parse(file_path);
switch (link) { switch (link) {
.file => |file| if (file.exists) .file => |file| if (file.exists)
return file_link.navigate(tp.self_pid(), &link), return file_link.navigate(tp.self_pid(), &link),