Skip to content

Commit

Permalink
Improve text match splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru committed May 26, 2020
1 parent 72550d1 commit d52ca79
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/vs/workbench/contrib/scm/browser/repositoryPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,18 @@ function splitMatches(uri: URI, filterData: FuzzyScore | undefined): [IMatch[] |
const allMatches = createMatches(filterData);

for (const match of allMatches) {
if (match.end <= fileName.length) {
matches!.push(match);
if (match.start < fileName.length) {
matches!.push(
{
start: match.start,
end: Math.min(match.end, fileName.length)
}
);
} else {
descriptionMatches!.push(
{
start: match.start - fileName.length,
end: match.end - fileName.length
start: match.start - (fileName.length + 1),
end: match.end - (fileName.length + 1)
}
);
}
Expand Down Expand Up @@ -403,7 +408,7 @@ export class SCMTreeKeyboardNavigationLabelProvider implements ICompressibleKeyb
const fileName = basename(element.sourceUri);
const filePath = this.labelService.getUriLabel(dirname(element.sourceUri), { relative: true });

return filePath.length !== 0 ? `${fileName}${filePath}` : fileName;
return filePath.length !== 0 ? `${fileName} ${filePath}` : fileName;
}
}

Expand Down

0 comments on commit d52ca79

Please sign in to comment.