Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 70b2803

Browse files
committed
Merge pull request #5793 from SAPlayer/find-in-files-focus
Fix #5699: Set focus to input field when hitting Find In Files when it is already open
2 parents 530a1e0 + 40a0962 commit 70b2803

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/search/FindInFiles.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,13 @@ define(function (require, exports, module) {
810810
var currentEditor = EditorManager.getActiveEditor(),
811811
initialString = currentEditor && currentEditor.getSelectedText();
812812

813+
if (dialog && !dialog.closed && dialog.hasOwnProperty("modalBar") && dialog.modalBar) {
814+
// The modalBar was already up. When creating the new modalBar, copy the
815+
// current query instead of using the passed-in selected text.
816+
initialString = dialog.getDialogTextField().val();
817+
dialog.modalBar.close(true, false);
818+
}
819+
813820
dialog = new FindInFilesDialog();
814821
searchResults = {};
815822
currentStart = 0;

0 commit comments

Comments
 (0)