mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-04 15:54:00 +01:00
Move check after establishing results DOM elem
This commit is contained in:
@@ -2831,6 +2831,11 @@ var ICEcoder = {
|
||||
findReplace: function(find, selectNext, canActionChanges, findPrevious) {
|
||||
let replace, results, thisCM, thisSelection, rBlocks, rExpMatch0String, replaceQS, targetQS, filesQS;
|
||||
|
||||
// Determine our find rExp, replace value and results display
|
||||
const rExp = new RegExp(true === parent.ICEcoder.findRegex ? find : ICEcoder.escapeRegex(find), "gi");
|
||||
replace = get('replace').value;
|
||||
results = get('results');
|
||||
|
||||
// Return early if we're finding with regex and only have ^ or $ or .*, avoids CPU crash
|
||||
if (true === parent.ICEcoder.findRegex && "" === find.replace(/\^|\$|\.\*/g, "")) {
|
||||
results.innerHTML = "No results";
|
||||
@@ -2840,11 +2845,6 @@ var ICEcoder = {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Determine our find rExp, replace value and results display
|
||||
const rExp = new RegExp(true === parent.ICEcoder.findRegex ? find : ICEcoder.escapeRegex(find), "gi");
|
||||
replace = get('replace').value;
|
||||
results = get('results');
|
||||
|
||||
// Get CM pane
|
||||
thisCM = this.getThisCM();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user