diff --git a/src/vs/editor/contrib/find/findController.ts b/src/vs/editor/contrib/find/findController.ts index f82c32e9e1b77..e2d7aa8248ba3 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;