feat(buffers): move buffer lifetime management to new Buffer.Manager module

This commit is contained in:
CJ van den Berg 2025-01-21 21:42:36 +01:00
parent fbeaefe7ff
commit aa1e0674cc
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
6 changed files with 109 additions and 48 deletions

View file

@ -991,6 +991,10 @@ pub fn get_active_selection(allocator: std.mem.Allocator) ?[]u8 {
return editor.get_selection(sel, allocator) catch null;
}
pub fn get_buffer_manager() ?*@import("Buffer").Manager {
return if (current().mainview.dynamic_cast(mainview)) |mv_| &mv_.buffer_manager else null;
}
fn context_check() void {
if (instance_ == null) @panic("tui call out of context");
}