diff --git a/edit.js b/edit.js index 58c24d41..84d14beb 100644 --- a/edit.js +++ b/edit.js @@ -548,6 +548,12 @@ function setupGlobalSearch() { } function find(activeCM) { + editors.lastActive = activeCM; + var cm = getEditorInSight(); + if (cm != activeCM) { + cm.focus(); + activeCM = cm; + } var originalOpenDialog = activeCM.openDialog; activeCM.openDialog = function(template, callback, options) { originalOpenDialog.call(activeCM, findTemplate, function(query) {