Merge pull request #5984 from xtermjs/cursor/addons-functional-fixes-89d6

fix(addons): search bounds, webgl sort, web-links regex, fit height clamp
This commit is contained in:
Daniel Imms
2026-06-01 19:34:14 -07:00
committed by GitHub
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ export class SearchEngine {
this._terminal.clearSelection();
return undefined;
}
if (startCol > this._terminal.cols) {
if (startCol >= this._terminal.cols) {
throw new Error(`Invalid col: ${startCol} to search in terminal of ${this._terminal.cols} cols`);
}
@@ -57,7 +57,8 @@ function isUrl(urlString: string): boolean {
export class LinkComputer {
public static computeLink(y: number, regex: RegExp, terminal: Terminal, activate: (event: MouseEvent, uri: string) => void): ILink[] {
const rex = new RegExp(regex.source, (regex.flags || '') + 'g');
const flags = regex.flags.includes('g') ? regex.flags : `${regex.flags}g`;
const rex = new RegExp(regex.source, flags);
const [lines, startLineIndex] = LinkComputer._getWindowedLineStrings(y - 1, terminal);
const line = lines.join('');
+1 -1
View File
@@ -191,7 +191,7 @@ export class TextureAtlas implements ITextureAtlas {
return newPage;
}
const sortedMergingPagesIndexes = mergingPages.map(e => e.glyphs[0].texturePage).sort((a, b) => a > b ? 1 : -1);
const sortedMergingPagesIndexes = mergingPages.map(e => e.glyphs[0].texturePage).sort((a, b) => a - b);
const mergedPageIndex = this.pages.length - mergingPages.length;
// Merge into the new page