mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-27 17:53:55 +00:00
renderer: receive message with viewport match selections
Doesn't draw yet
This commit is contained in:
@@ -122,6 +122,16 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
|
||||
scrollbar: terminal.Scrollbar,
|
||||
scrollbar_dirty: bool,
|
||||
|
||||
/// The most recent viewport matches so that we can render search
|
||||
/// matches in the visible frame. This is provided asynchronously
|
||||
/// from the search thread so we have the dirty flag to also note
|
||||
/// if we need to rebuild our cells to include search highlights.
|
||||
///
|
||||
/// Note that the selections MAY BE INVALID (point to PageList nodes
|
||||
/// that do not exist anymore). These must be validated prior to use.
|
||||
search_matches: ?renderer.Message.SearchMatches,
|
||||
search_matches_dirty: bool,
|
||||
|
||||
/// The current set of cells to render. This is rebuilt on every frame
|
||||
/// but we keep this around so that we don't reallocate. Each set of
|
||||
/// cells goes into a separate shader.
|
||||
@@ -672,6 +682,8 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
|
||||
.focused = true,
|
||||
.scrollbar = .zero,
|
||||
.scrollbar_dirty = false,
|
||||
.search_matches = null,
|
||||
.search_matches_dirty = false,
|
||||
|
||||
// Render state
|
||||
.cells = .{},
|
||||
@@ -744,7 +756,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
|
||||
|
||||
pub fn deinit(self: *Self) void {
|
||||
self.terminal_state.deinit(self.alloc);
|
||||
|
||||
if (self.search_matches) |*m| m.arena.deinit();
|
||||
self.swap_chain.deinit();
|
||||
|
||||
if (DisplayLink != void) {
|
||||
|
||||
Reference in New Issue
Block a user