feat: fuzzy file search with @ prefix

- Type @ to fuzzy-search files/folders across project
- Respects .gitignore and skips hidden files
- Pure Node.js implementation using readdir with withFileTypes
- No external dependencies (fd/find) required
- Also optimized Tab completion to use withFileTypes instead of statSync

Based on PR #60 by @fightbulc, reimplemented for performance.
This commit is contained in:
Mario Zechner 2025-11-27 00:59:12 +01:00
parent 4de46fbab3
commit 384e4a3a7d
5 changed files with 137 additions and 224 deletions

View file

@ -2,6 +2,10 @@
## [Unreleased]
### Added
- **Fuzzy File Search (`@`)**: Type `@` followed by a search term to fuzzy-search files and folders across your project. Respects `.gitignore` and skips hidden files. Directories are prioritized in results. Based on [PR #60](https://github.com/badlogic/pi-mono/pull/60) by [@fightbulc](https://github.com/fightbulc), reimplemented with pure Node.js for fast, dependency-free searching.
### Fixed
- **Emoji Text Wrapping Crash**: Fixed crash when rendering text containing emojis (e.g., 😂) followed by long content like URLs. The `breakLongWord` function in `pi-tui` was iterating over UTF-16 code units instead of grapheme clusters, causing emojis (which are surrogate pairs) to be miscounted during line wrapping. Now uses `Intl.Segmenter` to properly handle multi-codepoint characters.

View file

@ -469,9 +469,8 @@ Type **`@`** to fuzzy-search for files and folders in your project:
- Directories are prioritized and shown with trailing `/`
- Autocomplete triggers immediately when you type `@`
- Use **Up/Down arrows** to navigate, **Tab**/**Enter** to select
- Only shows attachable files (text, code, images) and directories
Uses `fdfind`/`fd` for fast searching if available, falls back to `find` on all Unix systems.
Respects `.gitignore` files and skips hidden files/directories.
### Path Completion