Skip to content

Commit

Permalink
css user-select:none could lead infinite loop in visual.highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
brookhong committed Apr 20, 2024
1 parent 40cf49d commit 5940fb2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/content_scripts/common/visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,12 @@ function createVisual(clipboard, hints) {
});
var scrollTop = document.scrollingElement.scrollTop;
selection.setPosition(null, 0);
var lastNode = null
while (findNextTextNodeBy(pattern.source, pattern.flags.indexOf('i') === -1, false)) {
if (lastNode == selection.anchorNode) {
break;
}
lastNode = selection.anchorNode
if (selection.anchorNode !== selection.focusNode) {
createMatchMark(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
}
Expand Down

0 comments on commit 5940fb2

Please sign in to comment.