Skip to content

Commit 8528e8e

Browse files
authored
Merge pull request #3710 from Tyriar/3705
Don't override decoration positions
2 parents 7836097 + 1f690c7 commit 8528e8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

addons/xterm-addon-search/src/SearchAddon.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ export class SearchAddon implements ITerminalAddon {
610610
if (marker) {
611611
this._selectedDecoration = terminal.registerDecoration({
612612
marker,
613+
x: result.col,
614+
width: result.size,
613615
overviewRulerOptions: {
614616
color: decorations.activeMatchColorOverviewRuler
615617
}
@@ -642,8 +644,6 @@ export class SearchAddon implements ITerminalAddon {
642644
}
643645
if (!element.classList.contains('xterm-find-result-decoration')) {
644646
element.classList.add('xterm-find-result-decoration');
645-
element.style.left = `${element.clientWidth * result.col}px`;
646-
element.style.width = `${element.clientWidth * result.term.length}px`;
647647
if (backgroundColor) {
648648
element.style.backgroundColor = backgroundColor;
649649
}
@@ -667,6 +667,8 @@ export class SearchAddon implements ITerminalAddon {
667667
}
668668
const findResultDecoration = terminal.registerDecoration({
669669
marker,
670+
x: result.col,
671+
width: result.size,
670672
overviewRulerOptions: this._resultDecorations.get(marker.line) && !this._dataChanged ? undefined : {
671673
color: decorations.matchOverviewRuler, position: 'center'
672674
}

0 commit comments

Comments
 (0)