use a class

This commit is contained in:
meganrogge
2022-03-11 12:43:09 -05:00
parent da2c59d1d0
commit 453cb00807
2 changed files with 11 additions and 4 deletions
+6 -4
View File
@@ -539,10 +539,12 @@ export class SearchAddon implements ITerminalAddon {
}
const findResultDecoration = terminal.registerDecoration({ marker });
findResultDecoration?.onRender((e) => {
e.style.backgroundColor = 'blue';
e.style.opacity = '60%';
e.style.left = `${result.col * e.clientWidth}px`;
e.style.width = `${e.clientWidth * result.term.length}px`;
if (!e.classList.contains('xterm-find-result-decoration')) {
e.classList.add('xterm-find-result-decoration');
// decoration's clientWidth = actualCellWidth
e.style.left = `${e.clientWidth * result.col}px`;
e.style.width = `${e.clientWidth * result.term.length}px`;
}
});
return findResultDecoration;
}
+5
View File
@@ -178,3 +178,8 @@
z-index: 6;
position: absolute;
}
.xterm-find-result-decoration {
background-color: blue;
opacity: 60%;
}