diff options
Diffstat (limited to 'core/Pick.zig')
| -rw-r--r-- | core/Pick.zig | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/Pick.zig b/core/Pick.zig index 6d2c9ba1..ab63cc5d 100644 --- a/core/Pick.zig +++ b/core/Pick.zig @@ -1012,7 +1012,10 @@ pub fn key(p: *Pardes, k: Key) void { } if (plain and k.cp == Key.enter) return apply(p, pk, refAt(p, pk) orelse return); if (pk.source == .actions and plain and s.field.len == 0 and k.cp >= '1' and k.cp <= '9') return apply(p, pk, k.cp - '1'); - if (s.rows.key(k, n)) return; + if (s.rows.key(k, n)) { + pk.names.reachTo(@as(usize, s.rows.at) + Band.Cursor.shown); + return; + } if (s.field.key(k)) filter(p, pk); return; } @@ -1054,7 +1057,11 @@ pub fn key(p: *Pardes, k: Key) void { return; } if (plain and k.cp == Key.backspace and s.field.len == 0) return back(p, pk); - if (s.rows.key(k, n)) return; + // A cursor gone past the rows sorted sorts as far (Names.reach). + if (s.rows.key(k, n)) { + if (fuzzy(pk)) pk.names.reachTo(@as(usize, s.rows.at) + Band.Cursor.shown); + return; + } if (s.field.key(k)) filter(p, pk); } @@ -1210,6 +1217,7 @@ fn keep(p: *Pardes, pk: *Pick) void { out.writer.print("{s} ", .{pk.word.slice()}) catch return; for (pk.refined[0..pk.nrefined]) |r| out.writer.print("{s} | ", .{r.query.slice()}) catch return; out.writer.print("{s}\n", .{s.field.text()}) catch return; + if (fuzzy(pk)) pk.names.reachTo(Query.max_rows); var kept: usize = 0; for (0..count(p, pk)) |i| { if (kept == Query.max_rows) break; |
