feat(search): add Alt+C case-insensitive toggle#81
Open
roramirez wants to merge 1 commit into
Open
Conversation
Scrollback search was regex-based and always case-sensitive. Alt+C in Search mode now flips a per-session case-insensitivity flag, recomputes matches live via RegexBuilder::case_insensitive, and the status bar shows [i] while active. Plain c still copies the current match.
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
Scrollback search is regex-based and was always case-sensitive. This adds an
Alt+Ctoggle inside Search mode that flips case sensitivity and recomputes matches live. When case-insensitive matching is active, the status bar search info shows a trailing[i]indicator.Changes
src/search.rs:compute_search_matchesnow takes acase_insensitive: booland builds the regex viaregex::RegexBuilder::new(query).case_insensitive(..).build()(still falls back to empty matches on invalid regex).src/app_state.rs: addsearch_case_insensitive: booltoAppState(defaultfalse), thread it intoupdate_search_matches.src/app_event.rs:handle_search_keydetectsAlt+C(checkingself.modifiers.state().alt_key()) before the copy-current-match interception, flips the flag, and recomputes. Plainc/Ctrl+Cstill copy the current match.src/renderer/text.rs+render_ops.rs: thread the flag throughdraw→draw_status_bar→draw_search_info, rendering the[i]indicator.search_test.rs(case-sensitive vs case-insensitive match counts),app_state_test.rs(toggling the flag and recomputing changes the match count); existing renderer/scenario call sites updated for the new parameter.CHANGELOG.md,doc/SPEC.md,README.md.How to test
cargo test— new testscase_sensitive_misses_differing_case,case_insensitive_matches_all_cases,toggling_case_insensitive_changes_match_countpass; full suite green./, type a lowercase query that appears in mixed case, pressAlt+C— match count increases and[i]appears in the status bar; pressAlt+Cagain to revert. Confirm plaincstill copies the current match.