diff options
Diffstat (limited to 'core/mouse.zig')
| -rw-r--r-- | core/mouse.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/mouse.zig b/core/mouse.zig index f97bc39b..400d020b 100644 --- a/core/mouse.zig +++ b/core/mouse.zig @@ -905,6 +905,18 @@ fn bandPress(p: *Pardes, button: Mouse.Button, point: BandPoint) void { if (button != config.exec_button and button != config.look_button) return; const word = (pardes.Band.wordAt(p, arena, point.id, point.line, point.col) catch return) orelse return; const kept = arena.dupe(u8, word) catch return; + // A picker's band: B2 runs the word with the picker live (an act's word + // acts, Pick.execWord); B3 on a row lands on it. + if (v.tag_state.kind == .pick) { + if (button == config.exec_button) return exec.runBuiltin(p, config.exec_cmd, v.active, "", kept); + const band = (pardes.Band.of(p, arena, p.panes[point.id].?, point.id) catch return) orelse return; + const ln = band.line(arena, p.settings.tab, point.line) catch return; + for (ln.parts) |part| if (point.col >= part.col and point.col < part.col + part.width) { + pardes.TagState.point(p, part.row.index); + return pardes.Pick.landHere(p); + }; + return; + } pardes.TagState.toRest(p); exec.runBuiltin(p, if (button == config.exec_button) config.exec_cmd else config.look_cmd, v.active, "", kept); } |
