Skip to content

Commit f962f52

Browse files
rebornixdbaeumer
authored andcommitted
Fix microsoft#27265. False positve
1 parent f0ebd2b commit f962f52

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/editor/contrib/find/common/findController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,13 @@ export class StartFindReplaceAction extends EditorAction {
508508
let controller = CommonFindController.get(editor);
509509
let currentSelection = editor.getSelection();
510510
// we only seed search string from selection when the current selection is single line and not empty.
511-
let seedSearchStringFromSelection = currentSelection.isEmpty() ||
512-
currentSelection.startLineNumber !== currentSelection.endLineNumber;
511+
let seedSearchStringFromSelection = !currentSelection.isEmpty() &&
512+
currentSelection.startLineNumber === currentSelection.endLineNumber;
513513
let oldSearchString = controller.getState().searchString;
514514
// if the existing search string in find widget is empty and we don't seed search string from selection, it means the Find Input
515515
// is still empty, so we should focus the Find Input instead of Replace Input.
516-
let shouldFocus = !oldSearchString && seedSearchStringFromSelection ?
517-
FindStartFocusAction.FocusFindInput : FindStartFocusAction.FocusReplaceInput;
516+
let shouldFocus = (!!oldSearchString || seedSearchStringFromSelection) ?
517+
FindStartFocusAction.FocusReplaceInput : FindStartFocusAction.FocusFindInput;
518518

519519
if (controller) {
520520
controller.start({

0 commit comments

Comments
 (0)