Prevent infinite loop for single-word texts (#7327)

This commit is contained in:
yaisog
2023-03-04 13:37:16 +00:00
committed by GitHub
parent 0eb6569674
commit b548b29b2b
+1 -1
View File
@@ -112,7 +112,7 @@ function diffPartsToChars(text1,text2,mode) {
if(mode === "words") {
regexpResult = searchRegexp.exec(text);
lineEnd = searchRegexp.lastIndex;
if(lineEnd === null) {
if(regexpResult === null) {
lineEnd = text.length;
}
lineEnd = --lineEnd;