Merge branch 'master' into zig-0.14

This commit is contained in:
CJ van den Berg 2025-03-04 21:15:14 +01:00
commit a959563bc7
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
11 changed files with 253 additions and 75 deletions

View file

@ -133,6 +133,8 @@ fn init(allocator: Allocator) !*Self {
self.rdr_.dispatch_event = dispatch_event;
try self.rdr_.run();
try project_manager.start();
try frame_clock.start();
try self.commands.init(self);
errdefer self.deinit();
@ -895,6 +897,15 @@ const cmds = struct {
pub const move_to_char_meta: Meta = .{ .description = "Move cursor to matching character" };
pub fn open_file(self: *Self, ctx: Ctx) Result {
if (get_active_selection(self.allocator)) |text| {
defer self.allocator.free(text);
const link = try root.file_link.parse(text);
switch (link) {
.file => |file| if (file.exists)
return root.file_link.navigate(tp.self_pid(), &link),
else => {},
}
}
return enter_mini_mode(self, @import("mode/mini/open_file.zig"), ctx);
}
pub const open_file_meta: Meta = .{ .description = "Open file" };