Skip to content

Commit

Permalink
Fix #27265. False positve
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed May 25, 2017
1 parent 796f945 commit d8c1adb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vs/editor/contrib/find/common/findController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,13 @@ export class StartFindReplaceAction extends EditorAction {
let controller = CommonFindController.get(editor);
let currentSelection = editor.getSelection();
// we only seed search string from selection when the current selection is single line and not empty.
let seedSearchStringFromSelection = currentSelection.isEmpty() ||
currentSelection.startLineNumber !== currentSelection.endLineNumber;
let seedSearchStringFromSelection = !currentSelection.isEmpty() &&
currentSelection.startLineNumber === currentSelection.endLineNumber;
let oldSearchString = controller.getState().searchString;
// if the existing search string in find widget is empty and we don't seed search string from selection, it means the Find Input
// is still empty, so we should focus the Find Input instead of Replace Input.
let shouldFocus = !oldSearchString && seedSearchStringFromSelection ?
FindStartFocusAction.FocusFindInput : FindStartFocusAction.FocusReplaceInput;
let shouldFocus = (!!oldSearchString || seedSearchStringFromSelection) ?
FindStartFocusAction.FocusReplaceInput : FindStartFocusAction.FocusFindInput;

if (controller) {
controller.start({
Expand Down

0 comments on commit d8c1adb

Please sign in to comment.