diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index d63c7beb..f1a804fc 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5677,29 +5677,19 @@ pub const Pardes = struct { for (p.panes) |slot| if (slot) |pane| { pane.msg_announcement = false; }; - switch (ev) { - // A batch of rows coming in is no gesture: a Look's hover stays. - .tick, .search => {}, - .mouse => |m| if (!(m.button == .none and m.kind == .motion)) { - p.raw_hover_intent = false; - look.cancelLookHover(p); - }, - .output => |o| if (look.lookHoverPane(p) == o.pane) { - p.raw_hover_intent = false; - look.cancelLookHover(p); - }, - .file_changed => |changed| if (look.lookHoverPane(p) == changed.pane) { - p.raw_hover_intent = false; - look.cancelLookHover(p); - }, - .pdf_scroll => |scroll| if (look.lookHoverPane(p) == scroll.pane) { - p.raw_hover_intent = false; - look.cancelLookHover(p); - }, - else => { - p.raw_hover_intent = false; - look.cancelLookHover(p); - }, + // A Look's hover outlives a tick, a batch of rows coming in (no + // gesture), a move with no button, and a change to another pane. + const hover_stays = switch (ev) { + .tick, .search => true, + .mouse => |m| m.button == .none and m.kind == .motion, + .output => |o| look.lookHoverPane(p) != o.pane, + .file_changed => |changed| look.lookHoverPane(p) != changed.pane, + .pdf_scroll => |scroll| look.lookHoverPane(p) != scroll.pane, + else => false, + }; + if (!hover_stays) { + p.raw_hover_intent = false; + look.cancelLookHover(p); } switch (ev) { .key, .mouse => { |
