@@ -59,8 +59,7 @@ function isMouseClick(event) {
5959 else return false ;
6060}
6161
62- function persistentDialog ( cm , text , deflt , onEnter , onKeyDown ) {
63- var replaceOpened = false ;
62+ function persistentDialog ( cm , text , deflt , onEnter , replaceOpened , onKeyDown ) {
6463 var searchField = document . getElementsByClassName ( "CodeMirror-search-field" ) [ 0 ] ;
6564 if ( ! searchField ) {
6665 cm . openDialog ( text , onEnter , {
@@ -335,7 +334,7 @@ function doSearch(cm, rev, persistent, immediate, ignoreQuery) {
335334 ( hiding = dialog ) . style . opacity = 0.4 ;
336335 } ) ;
337336 } ;
338- persistentDialog ( cm , queryDialog , q , searchNext , function ( event , query ) {
337+ persistentDialog ( cm , queryDialog , q , searchNext , false , function ( event , query ) {
339338 var keyName = CodeMirror . keyName ( event ) ;
340339 var cmd = CodeMirror . keyMap [ cm . getOption ( 'keyMap' ) ] [ keyName ] ;
341340 if ( ! cmd ) cmd = cm . getOption ( 'extraKeys' ) [ keyName ] ;
@@ -594,7 +593,9 @@ CodeMirror.commands.findPrev = function (cm) {
594593 doSearch ( cm , true ) ;
595594} ;
596595CodeMirror . commands . clearSearch = clearSearch ;
597- CodeMirror . commands . replace = doFindAndReplace ;
596+ CodeMirror . commands . replace = function ( cm ) {
597+ doFindAndReplace ( cm , false , true , false , true , true ) ;
598+ } ;
598599CodeMirror . commands . replaceAll = function ( cm ) {
599600 doFindAndReplace ( cm , true ) ;
600601} ;
0 commit comments