Skip to content

Match case and whole word in both find boxes, and skip what git ignores in Find in files - #530

Merged
jamescrosswell merged 2 commits into
mainfrom
feat/find-options
Oct 13, 2026
Merged

jamescrosswell merged 2 commits into
mainfrom
feat/find-options

Conversation

@a-team-app

@a-team-app a-team-app Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Both find boxes now have Case and Word checkboxes, and Find in files skips what git ignores, with an Ignored files checkbox to bring those files back.

  • Find bar (Ctrl+F, file and diff tabs): ☐ Case ☐ Word sit between the query and the count. Alt+C / Alt+W toggle them from either field, and so does a click. The search re-runs straight away. The options are shared by every tab for the session. Replace and Replace all follow them.
  • Find pane (Ctrl+Shift+F / Ctrl+Shift+H): Case and Word sit under the fields, with Ignored files below them. These options are separate from the bar's. In a repo, the pane searches what git ls-files --cached --others --exclude-standard lists, so .gitignore (nested ones too) and .git/info/exclude are honoured. Outside a repo, or if git fails, Ignored files is disabled, the old skip list applies, and the count reads e.g. 4 in 1 files (not a git repo).
  • Tab still goes straight between Find and Replace. The checkboxes don't take focus.
  • The palette and Edit menu offer Match case / Stop matching case, Match whole word / Stop matching whole word and Include ignored files / Skip ignored files. F1 and Settings list them as … on or off. Mnemonics are tmc, tmw and tfi. F1 in either box lists Alt+C / Alt+W.

Closes #527

Worth flagging

  • Case/Word/Ignored files are Global commands, enabled only while a find box has the keys. The bar's keys are in the Editor scope and the pane's in Find, and no one scope covers both. So Settings › Keyboard Shortcuts shows them under Global. Anywhere else they're disabled, so Alt+C / Alt+W fall through as before.
  • Whole word follows VS Code: if a query starts or ends with punctuation, that side counts as a word edge already, so .Id matches x.Id. _ counts as a word character, so _Id doesn't match Id.
  • The pane's count line now wraps to a second row when it's too long, so (not a git repo) reads in full at the sidebar's default width of 30.
  • In the bar, toggling an option re-runs the search from the current match, so the count can read 2 of 3 rather than starting again at 1.
  • Checked with tuirec at 80×24, default sidebar width:
    • In the bar, Case + Word on TextSearch.cs gives 1 of 2, highlighting only .Id / x.Id.
    • With the replace row showing, F1 lists the Alt+C / Alt+W rows.
    • In the pane on this repo, Id with Case + Word gives 180 in 66 files.
    • Clicking Case toggles it.
    • tfi brings in bin/ and obj/ (10000+ in 472 files).
    • In a folder outside any repo, Ignored files is dimmed and bin/ is skipped.
    • The Edit menu shows Stop matching case Alt+C and dims Include ignored files when opened from the bar.
  • Local test run: on this machine FocusHostTests and one HelpPlaceHostTests test hang on origin/main as well, so I didn't get a full run here. The classes this PR touches pass. CI is the full check.

🤖 Generated with Claude Code

a-team try tuicode 530

Short names were buried: both find boxes matched case-insensitively inside
words, and Find in files searched folders git ignores, so `Id` on this repo
found 9,805 matches and a Replace in files of `Id` would rewrite `Hidden`.

TextSearch takes MatchOptions (case, whole word), used by the bar, diff find,
the pane and both replace paths. The pane lists files with
`git ls-files --cached --others [--exclude-standard]`, falling back to the
fixed skip list outside a repo or when git fails. The three toggles are
Global commands enabled only while a find box has the keys, since the bar's
keys are in the Editor scope and the pane's in Find.

Closes #527

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
As a hint for Alt+C and Alt+W, matching the menus' letters. FindOption
underlines the hot letter but clears TG's hot key, which would otherwise
toggle the pane's options from anywhere. Also drops the machine-local
workspace entries the previous commit picked up.

Closes #527

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jamescrosswell
jamescrosswell merged commit e3430c1 into main Oct 13, 2026
30 checks passed
@jamescrosswell
jamescrosswell deleted the feat/find-options branch October 13, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Match case and whole word in both find boxes, and skip what git ignores in Find in files

1 participant