mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Using the global allocator
This commit is contained in:
@ -4325,10 +4325,8 @@ fn openScreenFile(
|
|||||||
std.log.debug("EDITOR environment variable not set", .{});
|
std.log.debug("EDITOR environment variable not set", .{});
|
||||||
return error.EnvironmentVariableNotFound;
|
return error.EnvironmentVariableNotFound;
|
||||||
};
|
};
|
||||||
const allocator = std.heap.page_allocator;
|
|
||||||
const command_buf = try allocator.alloc(u8, editor.len + file_path.len + 2);
|
const command_buf = try self.alloc.alloc(u8, editor.len + file_path.len + 2);
|
||||||
errdefer allocator.free(command_buf);
|
|
||||||
defer allocator.free(command_buf);
|
|
||||||
// This is quite ugly sending the message to the mailbox and executing it on behalf of the user
|
// This is quite ugly sending the message to the mailbox and executing it on behalf of the user
|
||||||
// Spawing a process doesn't render the command in the main surface.
|
// Spawing a process doesn't render the command in the main surface.
|
||||||
const command = try std.fmt.bufPrint(
|
const command = try std.fmt.bufPrint(
|
||||||
@ -4338,7 +4336,7 @@ fn openScreenFile(
|
|||||||
);
|
);
|
||||||
|
|
||||||
self.io.queueMessage(try termio.Message.writeReq(
|
self.io.queueMessage(try termio.Message.writeReq(
|
||||||
allocator,
|
self.alloc,
|
||||||
command,
|
command,
|
||||||
), .unlocked);
|
), .unlocked);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user