begin supporting global marks

This commit is contained in:
Robert Burnett 2025-05-12 11:38:41 -05:00 committed by CJ van den Berg
parent 2d583fbd9e
commit 4765f47dd0
2 changed files with 35 additions and 0 deletions

View file

@ -20,6 +20,12 @@ const MainView = @import("mainview.zig");
const Allocator = std.mem.Allocator;
pub const GlobalMarkLocation = struct {
row: usize,
col: usize,
filepath: [512]u8 = .{0} ** 512,
};
allocator: Allocator,
rdr_: renderer,
config_: @import("config"),
@ -62,6 +68,7 @@ fontfaces_: std.ArrayListUnmanaged([]const u8) = .{},
enable_mouse_idle_timer: bool = false,
query_cache_: *syntax.QueryCache,
frames_rendered_: usize = 0,
global_marks: [256]?GlobalMarkLocation = .{null} ** 256,
const keepalive = std.time.us_per_day * 365; // one year
const idle_frames = 0;
@ -1091,6 +1098,10 @@ fn current() *Self {
return instance_ orelse @panic("tui call out of context");
}
pub fn get_global_marks() *[256]?GlobalMarkLocation {
return &current().global_marks;
}
pub fn rdr() *renderer {
return &current().rdr_;
}