Disallow the empty string from being selected by find

This commit is contained in:
Daniel Imms
2018-09-10 12:17:17 -07:00
parent b2ba281916
commit 5e004b21a3
2 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ export class SearchHelper implements ISearchHelper {
if (searchOptions.regex) {
const searchRegex = RegExp(lowerTerm, 'g');
const foundTerm = searchRegex.exec(lowerStringLine);
if (foundTerm) {
if (foundTerm && foundTerm[0].length > 0) {
searchIndex = searchRegex.lastIndex - foundTerm[0].length;
term = foundTerm[0];
}