@Override
public void replace(Match match, String replacement) {
ScriptMatch scriptMatch = (ScriptMatch) match;
SearchAndReplaceTextTarget target = getTextToReplace(scriptMatch);
target.replace(scriptMatch.textLocation, replacement);
handleReplace(scriptMatch.script, target);
}
private SearchAndReplaceTextTarget getTextToReplace(ScriptMatch match) {
if (match == currentMatch && currentText != null) {