Workaround for hover firing multiple times

Fixes #2911
This commit is contained in:
Daniel Imms
2020-05-06 04:53:25 -07:00
parent 7ab0a42b24
commit f886698dc3
+10 -3
View File
@@ -132,9 +132,16 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
// There is no link cached, so ask for one
this._linkProviders.forEach((linkProvider, i) => {
const existingReply = this._activeProviderReplies?.get(i);
if (existingReply) {
linkProvided = this._checkLinkProviderResult(i, position, linkProvided);
if (useLineCache) {
const existingReply = this._activeProviderReplies?.get(i);
// If there isn't a reply, the provider hasn't responded yet.
// TODO: If there isn't a reply yet it means that the provider is still resolving. Ensuring
// provideLinks isn't triggered again saves ILink.hover firing twice though. This probably
// needs promises to get fixed
if (existingReply) {
linkProvided = this._checkLinkProviderResult(i, position, linkProvided);
}
} else {
linkProvider.provideLinks(position.y, (links: ILink[] | undefined) => {
if (this._isMouseOut) {