DonJayamanne / gitHistoryVSCode

Git History for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
MIT License
944 stars 150 forks source link

[BUG] Incorrect highlight of search result when viewing file history #757

Open wenfangdu opened 7 months ago

wenfangdu commented 7 months ago

Describe the Bug

image

Faulty code: https://github.com/DonJayamanne/gitHistoryVSCode/blob/9f06b485d3382413b4fd4129b1b7a68fd0f9d96b/browser/src/components/LogView/Commit/FileEntry/index.tsx#L70-L74

Steps To Reproduce

File structure: -src/index.tsx -eva/index.tsx

  1. Make changes to the above files and commit them
  2. Open src/index.tsx
  3. Use git.viewFileHistory
  4. Select the commit just made and search for "index"
  5. Both src/index.tsx and eva/index.tsx are highlighted

Expected Behavior

Only src/index.tsx should be highlighted.

Environment