mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-11-03 07:18:30 +00:00
Force a refresh after register/deregister link matcher
This commit is contained in:
parent
c8bb321654
commit
1c030f57ef
@ -98,14 +98,17 @@ export class Linkifier {
|
||||
/**
|
||||
* Deregisters a link matcher if it has been registered.
|
||||
* @param {number} matcherId The link matcher's ID (returned after register)
|
||||
* @return {boolean} Whether a link matcher was found and deregistered.
|
||||
*/
|
||||
public deregisterLinkMatcher(matcherId: number): void {
|
||||
public deregisterLinkMatcher(matcherId: number): boolean {
|
||||
// ID 0 is the hypertext link matcher which cannot be deregistered
|
||||
for (let i = 1; i < this._linkMatchers.length; i++) {
|
||||
if (this._linkMatchers[i].id === matcherId) {
|
||||
this._linkMatchers.splice(i, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1309,7 +1309,9 @@ Terminal.prototype.attachHypertextLinkHandler = function(handler) {
|
||||
*/
|
||||
Terminal.prototype.registerLinkMatcher = function(regex, handler, matchIndex) {
|
||||
if (this.linkifier) {
|
||||
return this.linkifier.registerLinkMatcher(regex, handler, matchIndex);
|
||||
var matcherId = this.linkifier.registerLinkMatcher(regex, handler, matchIndex);
|
||||
this.refresh(0, this.rows - 1);
|
||||
return matcherId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1319,7 +1321,9 @@ Terminal.prototype.registerLinkMatcher = function(regex, handler, matchIndex) {
|
||||
*/
|
||||
Terminal.prototype.deregisterLinkMatcher = function(matcherId) {
|
||||
if (this.linkifier) {
|
||||
this.linkifier.deregisterLinkMatcher(matcherId);
|
||||
if (this.linkifier.deregisterLinkMatcher(matcherId)) {
|
||||
this.refresh(0, this.rows - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user