Comprehensive ripgrep search dialog with full option wiring#20
Merged
bluestreak01 merged 1 commit intomasterfrom Apr 16, 2026
Merged
Comprehensive ripgrep search dialog with full option wiring#20bluestreak01 merged 1 commit intomasterfrom
bluestreak01 merged 1 commit intomasterfrom
Conversation
Expand the file search dialog (Ctrl+S) from a minimal 4-option form into a full ripgrep configuration interface exposing ~30 rg CLI options, wire all options to the grep-regex/grep-searcher/ignore library builders, and add interactive features for discoverability and usability. Dialog form: - 6 text inputs: pattern (-e), replace (-r), path, glob (-g), type (-t), type-not (-T) with rg flag labels on every field - 9 search checkboxes: regex, case insensitive (-i), smart case (-S), word regexp (-w), line regexp (-x), invert match (-v), multiline (-U), multiline dot-all, CRLF - 8 filter checkboxes: hidden (-.), follow symlinks (-L), no-ignore, binary as text (-a), search zip (-z), glob case insensitive, one file system, trim whitespace - 6 limit inputs: before context (-B), after context (-A), max depth (-d), max count (-m), max filesize, encoding (-E) - All options persist across sessions via state.rs Auto-complete and contextual help: - File type fields (-t/-T) show auto-complete dropdown as you type, sourced from ignore::TypesBuilder defaults (~100 types) - F1 on any field shows contextual help with rg flag, description, and usage examples - F1 on type fields shows scrollable/filterable type list - F1 on glob field shows glob pattern reference Search engine wiring (SearchConfig → builders): - RegexMatcherBuilder: case_insensitive, case_smart, word, whole_line, multi_line, dot_matches_new_line, crlf, fixed_strings - SearcherBuilder: invert_match, multi_line, before_context, after_context, binary_detection, encoding, line_terminator (CRLF) - WalkBuilder: hidden, git_ignore, follow_links, max_depth, max_filesize, same_file_system, ignore_case_insensitive - TypesBuilder: select/negate per comma-separated type name - OverrideBuilder: comma-separated glob patterns - Custom Sink impl for before/after context line capture - Manual max_count enforcement in sink callback - Trim whitespace in sink callback - parse_filesize helper with K/M/G suffixes and checked_mul overflow safety Search results panel: - Context lines rendered dimmer with space separator instead of colon - Type-to-filter within results (case-insensitive, matches text and paths) - Path-matching filter shows all file's matches - F4/Enter opens editor at match line - Editor close restores focus to search panel via pre_editor_focus tracking - Help dialog updated with filter/F4 keybindings Test coverage (48 tests): - Every rg option tested: regex, literal, case insensitive, smart case, word/line regexp, invert match, multiline, multiline dotall, CRLF, glob include/exclude/comma-separated, file type select/multiple/negate, hidden files, gitignore, no-ignore, max depth, max count, max filesize, trim whitespace, follow symlinks, before/after context - parse_filesize: bytes, K/M/G, empty, invalid, overflow - SearchState: lifecycle, navigation, cancel-on-drop - Filter: by text, by path, empty, clamp, case insensitive - rg_file_types populated Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rgCLI flagsgrep-regex/grep-searcher/ignorelibrary buildersSinkfor before/after context line supportWhat changed
Dialog (Ctrl+S)
-e), replace (-r), path, glob (-g), type (-t), type-not (-T)-i), smart case (-S), word regexp (-w), line regexp (-x), invert match (-v), multiline (-U), multiline dot-all, CRLF-.), follow symlinks (-L), no-ignore, binary as text (-a), search zip (-z), glob case insensitive, one file system, trim whitespace-B), after context (-A), max depth (-d), max count (-m), max filesize, encoding (-E)All fields show their rg short flag in the label. Every option persists across sessions.
Auto-complete & F1 help
-t type/-T type-notfields shows a dropdown of matching rg file types (~100 types fromignore::TypesBuilder)Search engine (
SearchConfig→ builders)RegexMatcherBuilder: case_insensitive, case_smart, word, whole_line, multi_line, dot_matches_new_line, crlf, fixed_stringsSearcherBuilder: invert_match, multi_line, before/after_context, binary_detection, encoding, line_terminatorWalkBuilder: hidden, git_ignore, follow_links, max_depth, max_filesize, same_file_system, ignore_case_insensitiveTypesBuilder: select/negate per comma-separated typeSinkimplementation captures both match and context linesparse_filesizewith K/M/G suffixes andchecked_muloverflow protectionSearch results panel
Test plan
cargo check— compilescargo fmt --check— formattedcargo clippy -- -W clippy::all— no warningscargo test— 48 tests pass (all search options, filter, state, edge cases)🤖 Generated with Claude Code