@@ -59,8 +59,7 @@ function isMouseClick(event) {
59
59
else return false ;
60
60
}
61
61
62
- function persistentDialog ( cm , text , deflt , onEnter , onKeyDown ) {
63
- var replaceOpened = false ;
62
+ function persistentDialog ( cm , text , deflt , onEnter , replaceOpened , onKeyDown ) {
64
63
var searchField = document . getElementsByClassName ( "CodeMirror-search-field" ) [ 0 ] ;
65
64
if ( ! searchField ) {
66
65
cm . openDialog ( text , onEnter , {
@@ -335,7 +334,7 @@ function doSearch(cm, rev, persistent, immediate, ignoreQuery) {
335
334
( hiding = dialog ) . style . opacity = 0.4 ;
336
335
} ) ;
337
336
} ;
338
- persistentDialog ( cm , queryDialog , q , searchNext , function ( event , query ) {
337
+ persistentDialog ( cm , queryDialog , q , searchNext , false , function ( event , query ) {
339
338
var keyName = CodeMirror . keyName ( event ) ;
340
339
var cmd = CodeMirror . keyMap [ cm . getOption ( 'keyMap' ) ] [ keyName ] ;
341
340
if ( ! cmd ) cmd = cm . getOption ( 'extraKeys' ) [ keyName ] ;
@@ -594,7 +593,9 @@ CodeMirror.commands.findPrev = function (cm) {
594
593
doSearch ( cm , true ) ;
595
594
} ;
596
595
CodeMirror . commands . clearSearch = clearSearch ;
597
- CodeMirror . commands . replace = doFindAndReplace ;
596
+ CodeMirror . commands . replace = function ( cm ) {
597
+ doFindAndReplace ( cm , false , true , false , true , true ) ;
598
+ } ;
598
599
CodeMirror . commands . replaceAll = function ( cm ) {
599
600
doFindAndReplace ( cm , true ) ;
600
601
} ;
0 commit comments