src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.ts/FindModel/research
class FindModel:	research() {
		if (!this._state.isRevealed) {
			this.set([], false);
			return;
		}

		const findMatches = this._getFindMatches();
		if (!findMatches) {
			return;
		}

		if (this._currentMatch === -1) {
			// no active current match
			this.set(findMatches, false);
			return;
		}

		const oldCurrIndex = this._findMatchesStarts!.getIndexOf(this._currentMatch);
		const oldCurrCell = this._findMatches[oldCurrIndex.index].cell;
		const oldCurrMatchCellIndex = this._notebookEditor.viewModel!.getCellIndex(oldCurrCell);

		if (oldCurrMatchCellIndex < 0) {
			// the cell containing the active match is deleted
			const focusedCell = this._notebookEditor.viewModel!.viewCells[this._notebookEditor.viewModel!.getFocus().start];

			if (!focusedCell) {
				this.set(findMatches, false);
				return;
			}

			const matchAfterSelection = findFirstInSorted(findMatches.map(match => match.index), index => index >= oldCurrMatchCellIndex);
			this._updateCurrentMatch(findMatches, this._matchesCountBeforeIndex(findMatches, matchAfterSelection));
			return;
		}

		// the cell still exist
		const cell = this._notebookEditor.viewModel!.viewCells[oldCurrMatchCellIndex];
		if (cell.cellKind === CellKind.Markup && cell.getEditState() === CellEditState.Preview) {
			// find the nearest match above this cell
			const matchAfterSelection = findFirstInSorted(findMatches.map(match => match.index), index => index >= oldCurrMatchCellIndex);
			this._updateCurrentMatch(findMatches, this._matchesCountBeforeIndex(findMatches, matchAfterSelection));
			return;
		}

		if ((cell.cellKind === CellKind.Markup && cell.getEditState() === CellEditState.Editing) || cell.cellKind === CellKind.Code) {
			// check if there is monaco editor selection and find the first match, otherwise find the first match above current cell
			// this._findMatches[cellIndex].matches[matchIndex].range
			const currentMatchDecorationId = this._currentMatchDecorations.find(decoration => decoration.ownerId === cell.handle);

			if (currentMatchDecorationId) {
				const currMatchRangeInEditor = (cell.editorAttached && currentMatchDecorationId.decorations[0] ? cell.getCellDecorationRange(currentMatchDecorationId.decorations[0]) : null)
					?? this._findMatches[oldCurrIndex.index].matches[oldCurrIndex.remainder].range;

				// not attached, just use the range
				const matchAfterSelection = findFirstInSorted(findMatches, match => match.index >= oldCurrMatchCellIndex);
				if (findMatches[matchAfterSelection].index > oldCurrMatchCellIndex) {
					// there is no search result in curr cell anymore
					this._updateCurrentMatch(findMatches, this._matchesCountBeforeIndex(findMatches, matchAfterSelection));
				} else {
					// findMatches[matchAfterSelection].index === currMatchCellIndex
					const cellMatch = findMatches[matchAfterSelection];
					const matchAfterOldSelection = findFirstInSorted(cellMatch.matches, match => Range.compareRangesUsingStarts(match.range, currMatchRangeInEditor) >= 0);
					this._updateCurrentMatch(findMatches, this._matchesCountBeforeIndex(findMatches, matchAfterSelection) + matchAfterOldSelection);
				}
			} else {
				const matchAfterSelection = findFirstInSorted(findMatches.map(match => match.index), index => index >= oldCurrMatchCellIndex);
				this._updateCurrentMatch(findMatches, this._matchesCountBeforeIndex(findMatches, matchAfterSelection));
			}

			return;
		}

		this.set(findMatches, false);
	}