diff --git a/src/content_scripts/common/visual.js b/src/content_scripts/common/visual.js index a18d9d92..e82116b4 100644 --- a/src/content_scripts/common/visual.js +++ b/src/content_scripts/common/visual.js @@ -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); }