snacks.nvim/lua/snacks/picker/util
Folke Lemaitre 3b54c8d3d1
feat(picker): add exact match position highlighting for grep results
Uses ripgrep's --replace feature to mark exact match positions with
separators (__snacks__${0}__snacks__), then parses these positions
for precise highlighting.

Benefits:
- Exact match highlighting in list, preview, and file formatter
- Works with any grep pattern (regex, fixed-string, case-insensitive)
- No need for pattern parsing or vim.regex workarounds
- Positions are provided directly by ripgrep, guaranteed accurate

Implementation:
- Added item.positions field to track match character indices
- New highlight.matches() helper for creating match extmarks
- Modified grep source to parse and extract positions from rg output
- Updated list, preview, and format to use positions when available

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 12:27:45 +02:00
..
async.lua perf(explorer): don't wait till git status finished. Update tree when needed. See #869 2025-02-02 14:29:19 +01:00
db.lua feat(picker.db): allow configuring the sqlite3 lib path. Closes #1025 2025-02-09 10:02:23 +01:00
highlight.lua feat(picker): add exact match position highlighting for grep results 2025-10-21 12:27:45 +02:00
history.lua fix(picker): do not record consecutive duplicate history (#2040) 2025-10-20 15:40:09 +02:00
init.lua fix(picker.format): added min_width for truncated paths 2025-10-21 08:14:34 +02:00
kv.lua perf(picker.frecency): cache all deadlines on load 2025-01-23 23:25:16 +01:00
minheap.lua fix(picker.minheap): clear sorted on minheap clear. Fixes #492 2025-01-15 21:31:59 +01:00
queue.lua perf(picker): small optims for abort 2025-01-21 12:16:16 +01:00