mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
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>
|
||
|---|---|---|
| .. | ||
| lsp | ||
| buffers.lua | ||
| diagnostics.lua | ||
| explorer.lua | ||
| files.lua | ||
| git.lua | ||
| grep.lua | ||
| help.lua | ||
| icons.lua | ||
| lazy.lua | ||
| lines.lua | ||
| meta.lua | ||
| proc.lua | ||
| qf.lua | ||
| recent.lua | ||
| snacks.lua | ||
| system.lua | ||
| treesitter.lua | ||
| vim.lua | ||