-
Streaming search inside pager Large text previews should support
/patternsearch without loading everything. We’ll do literal-only search with SIMD fast paths (AVX2/AVX-512 on amd64, NEON on arm64) and chunked streaming fallback.
Plan:- Input/UI: add
/to enter search mode, show query + hit index in status bar,n/N(or arrows) to jump next/prev,Escto exit. - Matcher: streaming literal search is in place; add SIMD fast paths (
memmem) with chunk overlap and keep line/col offsets for hits (pending). - Highlighting: store hit spans per line; on render, map spans to wrapped rows and inject ANSI; binary mode skips search.
- Navigation: maintain hit list + cursor; jumps update
PreviewScrollOffset/PreviewWrapOffsetto center the hit. - Performance/limits: cap buffered hits (e.g., 10k) and buffered lines (e.g., 20k); debounce query changes; fallback to pure Go
bytes.Indexwhen SIMD unavailable. (Optional tuning remains.)
- Input/UI: add
-
UTF-16 pager streaming
textPagerSourcenow streams UTF-16 LE/BE previews with shared decoder state, byte-offset aware line metadata, and copy-all support that loads the full file without re-decoding the head buffer. -
Window resize on Windows pager
Unix pagers now redraw immediately when the terminal resizes (SIGWINCH +select). Windows still requires a keypress because we never consumeWINDOW_BUFFER_SIZE_EVENT. Implement a Windows-specific key reader that usesReadConsoleInput/golang.org/x/sys/windowsto listen for bothKEY_EVENTandWINDOW_BUFFER_SIZE_EVENT, toggles raw mode viaSetConsoleMode, and pushes synthetic resize events into the pager loop sop.updateSize()/render()fire without waiting for input.
-
Token heuristics & order
During AND queries we currently sort tokens only by length. Explore heuristics based on selectivity (rareness, occurrence counts) to run the most discriminating token first and avoid extra DP passes. -
Lower-case name cache
Case-insensitive filtering/search constantly callsstrings.ToLowerper filename/path. Cache folded names inAppState(and refresh when directories reload) to reduce CPU/allocs on large trees. -
Result pooling
GlobalSearchResult/FileEntryallocations still dominate AND benchmarks (~5 MB/op). Investigate pooling or avoidingos.FileInfountil a result is promoted by the collector.
-
Preview pager PTY tests
Add end-to-end tests that runPreviewPager.Run()against a pseudo-terminal created with the standard library (golang.org/x/term+os.Pipe/syscall), drive key presses (e.g.,q,w,PgDn), and assert that the pager restores cursor visibility/DECAWM and renders expected headers/status for text and binary files. This would catch regressje typu “ukryty kursor po wyjściu” i dokumentować wymianę sekwencji sterujących. -
Optional: auto-jump search anchor
If we enable live jumping while typing, anchor to the view center on entering/, auto-center the first hit at/after that anchor as the query updates (debounced), and reset the anchor after manual jumps (n/N/Enter). Clearing (←) orEscshould restore the anchored view and clear results. Gate behind a preference (e.g.,PreviewSearchAutoJump) to avoid surprising motion by default.
-
Block jumps + offset status
Add[ / ]for ±4 KB and{ / }for ±64 KB jumps inPreviewPagerfor binaries; status shows current offset and file %. Pager-only; no preview panel change. -
Binary search
Remove the/blockade in binary mode (pager.go:1162-1168) after adding simple byte/ASCII search onbinarySource. Supportn/N, hit highlighting, respectsearchMaxHits/Lines. Preview panel remains without search. -
Adaptive hexdump width (pager)
binaryPagerSourcenow emits 8/16/24 bytes per row based on pager width; offset/hex/ASCII columns adapt accordingly. Inline preview stays fixed at 16 B to remain lightweight.
Follow-ups included: correct hit span mapping for 8/16/24, preserve byte position across resize/exit, and ensure hit-capped searches still highlight/navigate within the current viewport. -
Dual-column hex + text
Add a pager mode where each line shows hex plus parallel ASCII/UTF-8 decoding with non-printables masked; simple key toggle. Preview panel unchanged. -
Export visible block
Extend existingcopyVisibleToClipboardso binary mode can copy the current view as hex+ASCII (e.g., the ~256 B on screen) and optionally save totemp/. Pager-only. -
Lightweight format detection
Detect signatures (PNG/ZIP/ELF/Mach-O/PDF) when loading binaries; show a terse header in preview (e.g., type + section sizes) and richer detail in pager. Minimal I/O: first few hundred bytes, no full parse.
- Terminal palette awareness / adaptive theming
Detect terminal color capabilities and palette (truecolor vs 256, custom iTerm schemes), then adapt preview/pager styling accordingly: choose nearest palette colors when truecolor unavailable, or switch to palette-only SGR to eliminate tone drift. Expose a toggle/preference to force 24-bit or 256-color for consistent appearance across panels and pager.