Fix issue #1174 with span parsing (#1183)

This commit is contained in:
Levi Bard 2019-04-08 15:27:41 +02:00 committed by Konrad Pozniak
commit a2fa49aafb
2 changed files with 5 additions and 2 deletions

View file

@ -70,7 +70,10 @@ private fun findPattern(string: String, fromIndex: Int): FindCharsResult {
result.matchType = matchType
result.start = Math.max(0, i - finder.searchPrefixWidth)
findEndOfPattern(string, result, finder.pattern)
return result
if (result.start + finder.searchPrefixWidth <= i + 1 && // The found result is actually triggered by the correct search character
result.end >= result.start) { // ...and we actually found a valid result
return result
}
}
}
}