summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/Host.zig3
-rw-r--r--dev/gui/gui.zig8
-rw-r--r--dev/jump_trail.zig2
-rw-r--r--dev/lsp/lsp_client.zig9
-rw-r--r--dev/macos/Sources/AppDelegate.swift2
-rw-r--r--dev/root.zig6
-rw-r--r--dev/tui/tui.zig14
7 files changed, 21 insertions, 23 deletions
diff --git a/dev/Host.zig b/dev/Host.zig
index 24df3895..a23c9ef5 100644
--- a/dev/Host.zig
+++ b/dev/Host.zig
@@ -28,9 +28,6 @@ pub const VTable = struct {
/// Upgrade: this process exec'd as the pardes installed since, at
/// the step's end (upgrade.zig); `pane` hears why if it cannot be.
upgrade: ?*const fn (ctx: ?*anyopaque, pane: pardes.Pane.Id) void = null,
- /// Whether a newer pardes is installed at the path this process
- /// started from, to be said once (upgrade.zig): asked at a focus-in.
- newer_build: ?*const fn (ctx: ?*anyopaque) bool = null,
spawn: ?*const fn (ctx: ?*anyopaque, pane: pardes.Pane.Id, cwd: []const u8) void = null,
pty_write: ?*const fn (ctx: ?*anyopaque, pane: pardes.Pane.Id, bytes: []const u8) void = null,
pty_resize: ?*const fn (ctx: ?*anyopaque, pane: pardes.Pane.Id, cols: u16, rows: u16) void = null,
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index 49c412ba..c3272957 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -584,7 +584,7 @@ fn acknowledgeGuiFont(g: *const Gui, core: *pardes.Pardes) void {
/// A replica client's font is the window's raster state: it follows the
/// session's request by the face's name on this machine (fonts.fromSession),
/// never acknowledging it or otherwise changing the replicated core.
-fn syncReplicaFont(g: *Gui, f: *const @FieldType(pardes.config.Runtime, "font"), gpa: std.mem.Allocator) bool {
+fn syncReplicaFont(g: *Gui, f: *const @FieldType(pardes.config.Settings, "font"), gpa: std.mem.Allocator) bool {
const path = f.requested_path.get();
const name = f.requested_name.get();
if (path.len == 0 and name.len == 0) return false;
@@ -3312,7 +3312,7 @@ fn kindJob(ctx: ?*anyopaque, id: pardes.Pane.Id, serial: u32, token: u32) void {
fn search(ctx: ?*anyopaque, gen: u32) void {
const s = shellOf(ctx);
if (s.threads_ok) return pardes.Stream.start(s.io, s.gpa, s.core, gen, s.queue, Queue.pushSearch);
- pardes.Stream.runHere(s.core, gen);
+ pardes.Stream.runHere(s.core, gen, true);
}
/// Handover `seq`'s dump to its file, and a worker to carry it to another
@@ -5622,7 +5622,7 @@ fn cursorDecor(g: *Gui, gpa: std.mem.Allocator, surface: *const pardes.Surface,
/// The triangle overlay: the cursor's glide, over everything.
fn buildOverlay(
g: *Gui,
- which: pardes.config.Runtime.Pet,
+ which: pardes.config.Settings.Pet,
trail_on: bool,
surface: *const pardes.Surface,
now_ns: u64,
@@ -5671,7 +5671,7 @@ fn appendJumpTrail(g: *Gui, on: bool, surface: *const pardes.Surface, now_ns: u6
/// The workspace tag's pet (the Pet setting, gui/pet.zig): in the blank
/// end of the grid's first row, past the tag's text, in the tag's colours,
/// on the window's own clock. Nothing of it reaches the core.
-fn appendWorkspacePet(g: *Gui, which: pardes.config.Runtime.Pet, surface: *const pardes.Surface, builder: *OverlayBuilder) void {
+fn appendWorkspacePet(g: *Gui, which: pardes.config.Settings.Pet, surface: *const pardes.Surface, builder: *OverlayBuilder) void {
const kind: pet.Kind = @fromBackingInt(@backingInt(which));
if (kind == .off or surface.rows == 0 or surface.cols == 0) {
g.pet_state = .{};
diff --git a/dev/jump_trail.zig b/dev/jump_trail.zig
index 25eba636..05664ec1 100644
--- a/dev/jump_trail.zig
+++ b/dev/jump_trail.zig
@@ -4,7 +4,7 @@
//! the cursor of the Surface it shows, frame after frame, and times the fade
//! on its own clock; the tty tints those cells' ground toward the text, the
//! window draws over them. Nothing of it reaches the core, which keeps the
-//! setting alone (config.Runtime.jump_trail).
+//! setting alone (config.Settings.jump_trail).
const std = @import("std");
pub const life_ns: u64 = 120 * std.time.ns_per_ms;
diff --git a/dev/lsp/lsp_client.zig b/dev/lsp/lsp_client.zig
index 83aea44f..4ad8dace 100644
--- a/dev/lsp/lsp_client.zig
+++ b/dev/lsp/lsp_client.zig
@@ -783,8 +783,13 @@ fn answer(io: std.Io, arena: std.mem.Allocator, si: usize, req: lsp.Req, out: *s
if (!try timedWait(c, io, startup_deadline)) break;
}
if (starting or c.loading or c.progress > 0) {
- tr.note("{s} is still loading: waiting for it, then asking again", .{specs[si].name});
- post(si, .always, "{s} is still loading the workspace; the answer comes when it is done\u{2026}", .{specs[si].name});
+ // Said only when the server says it: a startup window that ran
+ // out with no word of loading is asked again quietly, and the
+ // message row keeps what it had (an empty answer is an answer).
+ if (c.loading or c.progress > 0) {
+ tr.note("{s} is still loading: waiting for it, then asking again", .{specs[si].name});
+ post(si, .always, "{s} is still loading the workspace; the answer comes when it is done\u{2026}", .{specs[si].name});
+ }
while ((c.loading or c.progress > 0) and c.gen == g and c.alive()) _ = try timedWait(c, io, nowMs() + 500);
out.end = before;
try attempt(c, io, si, arena, req, out, tr, g);
diff --git a/dev/macos/Sources/AppDelegate.swift b/dev/macos/Sources/AppDelegate.swift
index 767d3766..4168999f 100644
--- a/dev/macos/Sources/AppDelegate.swift
+++ b/dev/macos/Sources/AppDelegate.swift
@@ -132,7 +132,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate {
// to change the day macos_min_version reaches 14.
NSApp.activate(ignoringOtherApps: true)
- var runtime = pardes_runtime_s(
+ var runtime = pardes_callbacks_s(
userdata: Unmanaged.passUnretained(self).toOpaque(),
wakeup: { ud in
// A pty reader thread. Every other function in pardes.h is
diff --git a/dev/root.zig b/dev/root.zig
index 08c246fb..fb1d1ad9 100644
--- a/dev/root.zig
+++ b/dev/root.zig
@@ -26,9 +26,9 @@ test {
_ = glide;
// The frontends', which main.zig's test block collected: a shell's
// build (shell-test); the core without a terminal never compiled them.
- if (comptime @import("term_options").terminal) {
- if (comptime @import("pardes_config").platform == .tui) _ = tui;
- if (comptime @import("pardes_config").platform == .gui) _ = gui;
+ if (comptime @import("pardes_options").terminal) {
+ if (comptime @import("pardes_options").platform == .tui) _ = tui;
+ if (comptime @import("pardes_options").platform == .gui) _ = gui;
_ = vaxis_input;
_ = host_io.Ptys;
}
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig
index 25172b4a..5c1945e6 100644
--- a/dev/tui/tui.zig
+++ b/dev/tui/tui.zig
@@ -1251,7 +1251,6 @@ const Shell = struct {
.detach = detach,
.adopt = PtyCalls.adopt,
.upgrade = upgradeAsked,
- .newer_build = newerBuild,
.spawn = PtyCalls.spawn,
.pty_write = PtyCalls.write,
.pty_resize = PtyCalls.resize,
@@ -1365,12 +1364,6 @@ const Shell = struct {
const PtyCalls = host_io.Ptys.Calls(Shell);
- /// A client's own build is not the session's to say (its core's host
- /// is the session's, through the tape).
- fn newerBuild(ctx: ?*anyopaque) bool {
- return of(ctx).client == null and upgrade.newer();
- }
-
fn upgradeAsked(ctx: ?*anyopaque, id: pardes.Pane.Id) void {
const pane = id.index();
const s = of(ctx);
@@ -1700,7 +1693,10 @@ const Shell = struct {
c.link.gone = true;
return true;
},
- .focus_in => s.feed(.{ .focus = true }),
+ .focus_in => {
+ s.feed(.{ .focus = true });
+ if (s.client == null) upgrade.noticeNewer(s.core);
+ },
.focus_out => {
s.feed(.pointer_leave);
s.feed(.{ .focus = false });
@@ -2085,7 +2081,7 @@ const Shell = struct {
fn search(ctx: ?*anyopaque, gen: u32) void {
const s = of(ctx);
if (s.threads_ok) return pardes.Stream.start(s.io, s.gpa, s.core, gen, s, deliverSearch);
- pardes.Stream.runHere(s.core, gen);
+ pardes.Stream.runHere(s.core, gen, true);
}
/// A draw (api.draw) on a worker, as a job is.