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

Fix #5699: Set focus to input field when hitting Find In Files when it is already open #5793

Merged
merged 2 commits into from
Nov 3, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/search/FindInFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,13 @@ define(function (require, exports, module) {
var currentEditor = EditorManager.getActiveEditor(),
initialString = currentEditor && currentEditor.getSelectedText();

if (dialog && !dialog.closed && dialog.hasOwnProperty("modalBar") && dialog.modalBar) {
// The modalBar was already up. When creating the new modalBar, copy the
// current query instead of using the passed-in selected text.
initialString = dialog.getDialogTextField().val();
dialog.modalBar.close(true, false);
}

dialog = new FindInFilesDialog();
searchResults = {};
currentStart = 0;
Expand Down