diff options
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/macos.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/macos.zig b/runtime/macos.zig index 7485f472..efb2ddbc 100644 --- a/runtime/macos.zig +++ b/runtime/macos.zig @@ -411,10 +411,6 @@ export fn pardes_deinit() void { } pardes.lsp.setStatusSink(null, null); host_io.setExitWake(null, null); - if (st.inbox.lsp_task) |*t| { - t.future.cancel(st.io); - st.inbox.lsp_task = null; - } st.pipe_tasks.cancelAll(st.io); for (0..pardes.MAX_PANES) |pane| if (st.file_watches.entries[pane] != null) { const id: u8 = @intCast(pane); @@ -426,7 +422,7 @@ export fn pardes_deinit() void { hostWatchFile(theme_watch_pane, generation, null, 0); } for (0..pardes.MAX_PANES) |pane| reap(st, @intCast(pane)); - st.inbox.close(); + st.inbox.deinit(); st.file_watches.deinit(st.gpa); if (st.cells.len > 0) st.gpa.free(st.cells); for (st.layer_cells) |cells| st.gpa.free(cells); @@ -1220,20 +1216,22 @@ fn clearFrame(st: *State) void { fn blankTagCells(cells: []Cell, cols: u16, rows: u16, source: []const pardes.Cell, layers: []const pardes.Layer) void { for (layers) |layer| { if (layer.rows == 0 or layer.viewport.y >= rows or layer.viewport.x >= cols) continue; - const start = @as(usize, layer.viewport.y) * cols + layer.viewport.x; const count = @min(layer.viewport.w, cols - layer.viewport.x); // The tag text is the layer's to draw. (The look-hover's glass // rect went with the core's hover bit, stage 8's follow-up.) _ = source; - for (cells[start..][0..count]) |*cell| cell.* = encodeCell(.{}); + for (layer.viewport.y..@min(rows, @as(usize, layer.viewport.y) + layer.rows)) |row| { + const start = row * cols + layer.viewport.x; + for (cells[start..][0..count]) |*cell| cell.* = encodeCell(.{}); + } } } fn tagCursorCovered(core: *const pardes.Pardes) bool { const cursor = core.surface.cursor orelse return false; for (core.surface.tag_layers) |layer| { - if (layer.rows != 0 and cursor.y == layer.viewport.y and cursor.x >= layer.viewport.x and - cursor.x - layer.viewport.x < layer.viewport.w) return true; + if (cursor.y >= layer.viewport.y and cursor.y - layer.viewport.y < layer.rows and + cursor.x >= layer.viewport.x and cursor.x - layer.viewport.x < layer.viewport.w) return true; } return false; } @@ -1402,6 +1400,7 @@ export fn pardes_tag_layer_value(index: u32, field: u32) u32 { const st = &(state orelse return 0); if (index >= pardes.MAX_TAG_LAYERS) return 0; const layer = &st.core.surface.tag_layers[index]; + if (layer.rows == 0) return 0; return switch (field) { 0 => layer.cols, 1 => @backingInt(layer.kind), @@ -1420,6 +1419,7 @@ export fn pardes_tag_layer_value(index: u32, field: u32) u32 { const border = st.core.chrome().rule; break :rgb @as(u32, border[0]) << 16 | @as(u32, border[1]) << 8 | border[2]; }, + 13 => if (layer.cursor) |c| c.y else 65535, else => 0, }; } |
