mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 00:06:49 +00:00
Merge "Search & Replace: Fix using replace as first action"
This commit is contained in:
commit
6cc83d2f93
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue