Skip to content

Commit

Permalink
fix getWordAtText for webkit-based browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Apr 17, 2020
1 parent 39ebbba commit a3083e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/editor/common/model/wordHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ export function getWordAtText(column: number, wordDefinition: RegExp, text: stri
for (let i = 1; ; i++) {
// check time budget
if (Date.now() - t1 >= config.timeBudget) {
break;
// break;
}

// reset the index at which the regexp should start matching, also know where it
// should stop so that subsequent search don't repeat previous searches
const regexIndex = pos - config.windowSize * i;
wordDefinition.lastIndex = regexIndex;
wordDefinition.lastIndex = Math.max(0, regexIndex);
match = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);

// stop: found something
Expand Down

0 comments on commit a3083e5

Please sign in to comment.