refactor: add mainview.cancel_info_content and make add_info_content public

This commit is contained in:
CJ van den Berg 2025-12-08 16:07:29 +01:00
parent ce69f3596a
commit e85832c0cb
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1877,10 +1877,15 @@ fn clear_find_in_files_results(self: *Self, file_list_type: FileListType) void {
fl.reset();
}
fn add_info_content(self: *Self, content: []const u8) tp.result {
pub fn add_info_content(self: *Self, content: []const u8) tp.result {
if (content.len == 0) return;
_ = self.toggle_panel_view(info_view, .enable) catch |e| return tp.exit_error(e, @errorReturnTrace());
const info = self.get_panel_view(info_view) orelse @panic("info_view missing");
info.set_content(content) catch |e| return tp.exit_error(e, @errorReturnTrace());
tui.need_render();
}
pub fn cancel_info_content(self: *Self) tp.result {
_ = self.toggle_panel_view(info_view, .disable) catch |e| return tp.exit_error(e, @errorReturnTrace());
tui.need_render();
}