diff --git a/src/vs/editor/contrib/multicursor/multicursor.ts b/src/vs/editor/contrib/multicursor/multicursor.ts index 5d7fd73ffe9d464a38acb2db700b499879b770e2..cadc1efd03ffe5dfd02cb9cc1383c55f2c16209c 100644 --- a/src/vs/editor/contrib/multicursor/multicursor.ts +++ b/src/vs/editor/contrib/multicursor/multicursor.ts @@ -603,6 +603,17 @@ export class MultiCursorSelectionController extends Disposable implements IEdito matches = this._session.selectAll(); } + if (findState.searchScope) { + const state = findState.searchScope; + let inSelection: FindMatch[] | null = []; + for (let i = 0; i < matches.length; i++) { + if (matches[i].range.endLineNumber <= state.endLineNumber && matches[i].range.startLineNumber >= state.startLineNumber) { + inSelection.push(matches[i]); + } + } + matches = inSelection; + } + if (matches.length > 0) { const editorSelection = this._editor.getSelection(); // Have the primary cursor remain the one where the action was invoked