Fixes: #2346 - duplicated inline annotations#2347
Conversation
c27f87c to
2e77698
Compare
There was a problem hiding this comment.
Thank you for your contribution!
Since this is performance critical code, can you please change the following:
vscode-gitlens/src/annotations/lineAnnotationController.ts
Lines 255 to 265 in 2e77698
To:
const commitLines = new Map<number, GitCommit>();
for (const selection of selections) {
const state = this.container.lineTracker.getState(selection.active);
if (state?.commit == null) {
Logger.debug(scope, `Line ${selection.active} returned no commit`);
continue;
}
commitLines.set(selection.active, state.commit);
}And then:
vscode-gitlens/src/annotations/lineAnnotationController.ts
Lines 284 to 288 in 2e77698
To:
this.getPullRequests(repoPath, [...filter(commitLines, ([, commit]) => !commit.isUncommitted)], {
timeout: timeout,
})Thanks!
0158e7d to
d596a24
Compare
Thank you for the detailed solution! I've pushed your suggestions |
In case of multiple cursors (selections) in the same line, an annotation was created per selection, resulting in an odd experience. Filter out duplicated lines by the line number. Add author to CHANGELOG and README Fixes: gitkraken#2346
d596a24 to
416bec5
Compare

Description
Refs: #2346
In the case of multiple cursors (selections) in the same line, an annotation was created per selection, resulting in an odd experience. Filter out duplicated lines by the line number and commit sha (sha is a safety measure for the probably impossible case of 2 commits in the same line).
Checklist
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses