summaryrefslogtreecommitdiff
path: root/dev/gui
diff options
context:
space:
mode:
Diffstat (limited to 'dev/gui')
-rw-r--r--dev/gui/gui.zig13
1 files changed, 11 insertions, 2 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index f572a7ce..ccf9387b 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -2650,6 +2650,7 @@ const Shell = struct {
.open_link = openLink,
.start = host_io.startDetached,
.lsp = lsp,
+ .lsp_open = lspOpen,
.pipe = pipe,
.search = search,
.hand_over = handOver,
@@ -3225,6 +3226,13 @@ fn lsp(ctx: ?*anyopaque, req: host_io.Lsp.Request) void {
s.core.reportError(req.pane, "lsp", error.WorkersUnavailable);
}
+/// Not held for `threads_ok`: the boot's file and a restored session's are
+/// opened before `start`.
+fn lspOpen(ctx: ?*anyopaque, pane: pardes.Pane.Id) void {
+ const s = shellOf(ctx);
+ s.queue.openLsp(s.core, pane);
+}
+
fn pipe(ctx: ?*anyopaque, id: u32) void {
const s = shellOf(ctx);
if (s.threads_ok) return selection_pipe.start(s.io, s.gpa, s.core, &s.queue.pipe_tasks, id, s.queue, Queue.pushPipe);
@@ -6342,8 +6350,9 @@ test "tagline pointer mapping retains physical grips and carries logical text co
try std.testing.expectEqual(body_y, body.row);
try std.testing.expect(body.tag_hit == null);
- // The workspace tag's text starts TAG_TEXT_INSET cells in, as a pane's.
- const x_top = @as(f32, @floatFromInt(pardes.TAG_TEXT_INSET)) * body_w + 3.5 * tag_w;
+ // The window's tag's text starts where its words do, at the window
+ // row's right end (UX K'2).
+ const x_top = @as(f32, @floatFromInt(pardes.tagline.windowRow(core).words)) * body_w + 3.5 * tag_w;
const topbar = gridCellAtDimensions(&g, x_top, 0.5 * body_h, body_w, body_h, tag_w);
try std.testing.expectEqual(pixelCell(x_top, 10), topbar.col);
try std.testing.expectEqual(@as(u16, 3), topbar.tag_hit.?.col);