Skip to content

Commit f2d436d

Browse files
committed
Make match description update on value change
1 parent 8ee4670 commit f2d436d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

plugins/find-and-replace.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ codeInput.plugins.FindAndReplace = class extends codeInput.Plugin {
3434
if(!codeInput.pluginData.findAndReplace.dialog.classList.contains("code-input_find-and-replace_hidden-dialog")) {
3535
// Code updated and dialog open - re-highlight find matches
3636
codeInput.pluginData.findAndReplace.dialog.findMatchState.rehighlightMatches();
37+
this.updateMatchDescription(codeInput.pluginData.findAndReplace.dialog);
3738

3839
if(codeInput.pluginData.findAndReplace.dialog.findMatchState.numMatches == 0) {
3940
// No more matches after editing
@@ -429,15 +430,7 @@ codeInput.plugins.FindAndReplace.FindMatchState = class {
429430

430431
/* Highlight all currently found matches again if there are any matches */
431432
rehighlightMatches() {
432-
if(this.codeInput.value != this.lastValue) {
433-
this.updateMatches(this.lastSearchRegexp);
434-
} else {
435-
if(this.matchStartIndexes.length > 0) {
436-
for(let i = 0; i < this.matchStartIndexes.length; i++) {
437-
this.highlightMatch(i, this.codeInput.codeElement, this.matchStartIndexes[i], this.matchEndIndexes[i]);
438-
}
439-
}
440-
}
433+
this.updateMatches(this.lastSearchRegexp);
441434
this.focusMatch();
442435
}
443436

0 commit comments

Comments
 (0)