提交 f962f52c 编写于 作者: R rebornix 提交者: Dirk Baeumer

Fix #27265. False positve

上级 f0ebd2b4
......@@ -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({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册