Merge "Search & Replace: Fix using replace as first action"

This commit is contained in:
jenkins-bot 2018-11-30 23:35:24 +00:00 committed by Gerrit Code Review
commit 6cc83d2f93

View file

@ -930,13 +930,17 @@
// Do the replacement
$textarea.textSelection( 'encapsulateSelection', {
peri: actualReplacement,
replace: true } );
replace: true,
selectionStart: offset + match.index,
selectionEnd: offset + match.index + match[ 0 ].length,
selectPeri: true
} );
// Reload the text after replacement
text = $textarea.textSelection( 'getContents' );
}
// Find the next instance
offset = offset + match[ 0 ].length + actualReplacement.length;
offset = offset + match.index + actualReplacement.length;
textRemainder = text.substr( offset );
match = textRemainder.match( regex );