mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge branch 'master' into bug/demo_addons_list
This commit is contained in:
+1
-1
@@ -61,7 +61,7 @@
|
||||
"nyc": "^15.0.1",
|
||||
"playwright-core": "^0.11.1",
|
||||
"source-map-loader": "^0.2.4",
|
||||
"ts-loader": "^7.0.2",
|
||||
"ts-loader": "^7.0.3",
|
||||
"typescript": "3.8",
|
||||
"utf8": "^3.0.0",
|
||||
"webpack": "^4.43.0",
|
||||
|
||||
@@ -150,11 +150,39 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
|
||||
const linksWithState: ILinkWithState[] | undefined = links?.map(link => ({ link }));
|
||||
this._activeProviderReplies?.set(i, linksWithState);
|
||||
linkProvided = this._checkLinkProviderResult(i, position, linkProvided);
|
||||
|
||||
// If all providers have responded, remove lower priority links that intersect ranges of
|
||||
// higher priority links
|
||||
if (this._activeProviderReplies?.size === this._linkProviders.length) {
|
||||
this._removeIntersectingLinks(position.y, this._activeProviderReplies);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private _removeIntersectingLinks(y: number, replies: Map<Number, ILinkWithState[] | undefined>): void {
|
||||
const occupiedCells = new Set<number>();
|
||||
for (let i = 0; i < replies.size; i++) {
|
||||
const providerReply = replies.get(i);
|
||||
if (!providerReply) {
|
||||
continue;
|
||||
}
|
||||
for (let i = 0; i < providerReply.length; i++) {
|
||||
const linkWithState = providerReply[i];
|
||||
const startX = linkWithState.link.range.start.y < y ? 0 : linkWithState.link.range.start.x;
|
||||
const endX = linkWithState.link.range.end.y > y ? this._bufferService.cols : linkWithState.link.range.end.x;
|
||||
for (let x = startX; x <= endX; x++) {
|
||||
if (occupiedCells.has(x)) {
|
||||
providerReply.splice(i--, 1);
|
||||
break;
|
||||
}
|
||||
occupiedCells.add(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _checkLinkProviderResult(index: number, position: IBufferCellPosition, linkProvided: boolean): boolean {
|
||||
if (!this._activeProviderReplies) {
|
||||
return linkProvided;
|
||||
|
||||
@@ -5444,10 +5444,10 @@ triple-beam@^1.2.0, triple-beam@^1.3.0:
|
||||
resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9"
|
||||
integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==
|
||||
|
||||
ts-loader@^7.0.2:
|
||||
version "7.0.2"
|
||||
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-7.0.2.tgz#465bc904aea4c331e9550e7c7d75dd17a0b7c24c"
|
||||
integrity sha512-DwpZFB67RoILQHx42dMjSgv2STpacsQu5X+GD/H9ocd8IhU0m8p3b/ZrIln2KmcucC6xep2PdEMEblpWT71euA==
|
||||
ts-loader@^7.0.3:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-7.0.3.tgz#1ba06fd3dae612ecf8b952f89145f9ac7489805f"
|
||||
integrity sha512-BXAHfPjm3J//20ibuI30M+xgLpdIng68p2H952QqbbmDk7SW72HV42k9Gop7rMxuHvrXWjazWhKuyr9D9kKe3A==
|
||||
dependencies:
|
||||
chalk "^2.3.0"
|
||||
enhanced-resolve "^4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user