mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Add Search in Cell Selection to Notebook Find Widget (#213409)
* all search scope functionality except cell decorations * fix filter icon showing fake useage * decorations + css tweaking + PR feedback
This commit is contained in:
@@ -910,7 +910,18 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
|
||||
//#region Find
|
||||
find(value: string, options: INotebookSearchOptions): CellFindMatchWithIndex[] {
|
||||
const matches: CellFindMatchWithIndex[] = [];
|
||||
this._viewCells.forEach((cell, index) => {
|
||||
let findCells: CellViewModel[] = [];
|
||||
|
||||
const selectedRanges = options.selectedRanges?.map(range => this.validateRange(range)).filter(range => !!range);
|
||||
|
||||
if (options.searchInRanges && selectedRanges) {
|
||||
const selectedIndexes = cellRangesToIndexes(selectedRanges);
|
||||
findCells = selectedIndexes.map(index => this._viewCells[index]);
|
||||
} else {
|
||||
findCells = this._viewCells;
|
||||
}
|
||||
|
||||
findCells.forEach((cell, index) => {
|
||||
const cellMatches = cell.startFind(value, options);
|
||||
if (cellMatches) {
|
||||
matches.push(new CellFindMatchModel(
|
||||
|
||||
Reference in New Issue
Block a user