Skip to content

fix(pick): match repo paths only at path boundaries - #6

Open
qu8n wants to merge 1 commit into
iurysza:mainfrom
qu8n:fix/extensionless-basename-substring
Open

fix(pick): match repo paths only at path boundaries#6
qu8n wants to merge 1 commit into
iurysza:mainfrom
qu8n:fix/extensionless-basename-substring

Conversation

@qu8n

@qu8n qu8n commented Aug 25, 2026

Copy link
Copy Markdown

This PR fixes the picker that returned 42 rows in my herdr pane when there was just one file path. Many of these files don't exist on my screen. Every README.md in the repo turned up in this picker.

Repo paths are matched with joined.find(variant), and the variants include the basename minus .md. So a line mentioning research/breakout_qa_bot/README.md contains both README.md and README as substrings, and every markdown file with that basename matches. If there are 40 READMEs in the repo, all 40 rows will appear in the picker.

Still a substring search, but it now asks for a path boundary. A path character on the left rules a match out, and extensionless variants need a right edge as well, so bare README cannot claim README.md. src still shows up when only src/main.py is visible, and main.py:12 keeps its line number.

One test added, the other 133 pass. Note that a line holding just README.md still matches every namesake, through the base_variants block. That needs a policy so I left it to your call.

Repo paths were matched against the captured screen with a plain
substring search, and the variant list holds the basename with .md
cut off. So one visible research/breakout_qa_bot/README.md matched
both README.md and README, pulling every same-named markdown file
in the repo into the picker: 42 rows for a screen holding one path.

A path character to the left now disqualifies a match. Extensionless
variants need a clear right edge too, so bare README does not claim
README.md, while other variants keep the loose right edge that lets
src match when only src/main.py is visible.
@qu8n
qu8n force-pushed the fix/extensionless-basename-substring branch from 90dffa0 to de7d817 Compare August 25, 2026 16:08
@qu8n qu8n changed the title Match repo paths at path boundaries fix(pick): match repo paths only at path boundaries Aug 25, 2026
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.

1 participant