From 29df3f3ab1ee758f0aab95fd1833d6875cfb6271 Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 30 Oct 2020 15:13:22 -0700 Subject: [PATCH] Revert "fix #109756." This reverts commit dbe1475cfb29af9bb22fd39e7c61f43a1d6bb17d. --- src/vs/editor/contrib/find/findController.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/contrib/find/findController.ts b/src/vs/editor/contrib/find/findController.ts index f82c32e9e1b..e2d7aa8248b 100644 --- a/src/vs/editor/contrib/find/findController.ts +++ b/src/vs/editor/contrib/find/findController.ts @@ -38,10 +38,7 @@ export function getSelectionSearchString(editor: ICodeEditor, seedSearchStringFr const selection = editor.getSelection(); // if selection spans multiple lines, default search string to empty - if ( - (seedSearchStringFromSelection === 'single' && selection.startLineNumber === selection.endLineNumber) - || seedSearchStringFromSelection === 'multiple' - ) { + if (seedSearchStringFromSelection === 'single' && selection.startLineNumber === selection.endLineNumber) { if (selection.isEmpty()) { const wordAtPosition = editor.getConfiguredWordAtPosition(selection.getStartPosition()); if (wordAtPosition) { @@ -52,6 +49,10 @@ export function getSelectionSearchString(editor: ICodeEditor, seedSearchStringFr return editor.getModel().getValueInRange(selection); } } + } else if (seedSearchStringFromSelection === 'multiple') { + if (editor.getModel().getValueLengthInRange(selection) < SEARCH_STRING_MAX_LENGTH) { + return editor.getModel().getValueInRange(selection); + } } return null;