summaryrefslogtreecommitdiff
path: root/src/mouse.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:40:11 -0300
committerGabriel Schneider <[email protected]>2026-11-05 12:41:36 -0300
commit3f1533813b6692a736251e4d467a7f108229ddee (patch)
tree37a32c5ebbf9d3af08923856fd6fa516f3b33a39 /src/mouse.zig
parentcfd2b993feda1b3f7474225bb32db8cac8edc5ae (diff)
downloadpardes-3f1533813b6692a736251e4d467a7f108229ddee.tar.gz
pardes-3f1533813b6692a736251e4d467a7f108229ddee.zip
targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/mouse.zig')
-rw-r--r--src/mouse.zig13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/mouse.zig b/src/mouse.zig
index 6cec562d..e38d5d5f 100644
--- a/src/mouse.zig
+++ b/src/mouse.zig
@@ -178,7 +178,6 @@ fn cornerFixture(gpa: std.mem.Allocator) !*Pardes {
}
test "a pane's last row of text is no resize handle; the rule over the next pane is" {
- if (platform == .web) return;
const p = try cornerFixture(std.testing.allocator);
defer p.deinit();
const seam = seamRowOf(p, 1, 0);
@@ -190,7 +189,6 @@ test "a pane's last row of text is no resize handle; the rule over the next pane
}
test "a pane's grip dragged up or down its own column moves its top, down to the floor of the pane above" {
- if (platform == .web) return;
const p = try cornerFixture(std.testing.allocator);
defer p.deinit();
const upper = p.col_panes[1][0];
@@ -230,7 +228,7 @@ fn nudgeRightSeam(p: *Pardes, delta: i32) u16 {
pub const ChromeTarget = struct { col: u16, row: u16 };
-/// The chrome a press at `col`, `row` takes (web.zig): the tag rows; then,
+/// The chrome a press at `col`, `row` takes: the tag rows; then,
/// on the cell, a pane's grip, a column's handle or a seam; then a cell
/// away, any of a pane's tag, a handle or a seam.
pub fn chromeTarget(p: *const Pardes, col: u16, row: u16) ?ChromeTarget {
@@ -260,7 +258,6 @@ pub fn chromeTarget(p: *const Pardes, col: u16, row: u16) ?ChromeTarget {
}
test "a press near chrome takes it: the tag rows, a column's handle or a seam on its cell or a cell away, a pane's tag; nothing in a body" {
- if (platform == .web) return;
const p = try cornerFixture(std.testing.allocator);
defer p.deinit();
// Column 0's two panes share its rows evenly; column 1's lower one is
@@ -1156,8 +1153,8 @@ fn mirrorTtySelection(p: *Pardes, pane: *Pane) void {
/// second selects what edit.doubleClickRange says, from the caret the click
/// left. A plain click still puts the caret on its cell.
fn doubleClick(p: *Pardes, id: usize, t: *panes.Text, on_tag: bool, row: i32, col: i32) void {
- // The host's clock, which every host keeps (a libc clock is no clock on
- // the web) and a test's virtual one replaces.
+ // The host's clock, which every host keeps and a test's virtual one
+ // replaces.
const now: i64 = @intCast(p.now_ns / std.time.ns_per_ms);
const prev = p.last_click;
p.last_click = .{ .id = id, .on_tag = on_tag, .row = row, .col = col, .ms = now };
@@ -1588,7 +1585,6 @@ test "a corner drag's two axes clamp independently" {
}
test "a v-handle press at the RIGHT column's seam drags both boundaries" {
- if (platform == .web) return;
const p = try cornerFixture(std.testing.allocator);
defer p.deinit();
try std.testing.expectEqual(@as(usize, 2), p.col_n[1]);
@@ -1619,7 +1615,6 @@ test "a v-handle press at the RIGHT column's seam drags both boundaries" {
}
test "a tie row still moves the LEFT column's pane pair only" {
- if (platform == .web) return;
const p = try cornerFixture(std.testing.allocator);
defer p.deinit();
@@ -1645,7 +1640,6 @@ test "a tie row still moves the LEFT column's pane pair only" {
}
test "a v-handle press at nobody's seam is still a plain edge drag" {
- if (platform == .web) return;
const p = try cornerFixture(std.testing.allocator);
defer p.deinit();
const right_seam = nudgeRightSeam(p, 3);
@@ -1671,7 +1665,6 @@ test "a v-handle press at nobody's seam is still a plain edge drag" {
}
test "a RIGHT-column corner's two axes clamp independently" {
- if (platform == .web) return;
const p = try cornerFixture(std.testing.allocator);
defer p.deinit();
const right_seam = nudgeRightSeam(p, 3);