mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
clicking on two raw notebook output search results in sequence throws error (#184209)
Fixes #184187
This commit is contained in:
parent
be433ac136
commit
fde89caaad
|
@ -114,7 +114,7 @@ export class FindMatchDecorationModel extends Disposable {
|
||||||
|
|
||||||
const deltaDecorations: ICellModelDeltaDecorations[] = cellFindMatches.map(cellFindMatch => {
|
const deltaDecorations: ICellModelDeltaDecorations[] = cellFindMatches.map(cellFindMatch => {
|
||||||
// Find matches
|
// Find matches
|
||||||
const newFindMatchesDecorations: IModelDeltaDecoration[] = new Array<IModelDeltaDecoration>(cellFindMatch.length);
|
const newFindMatchesDecorations: IModelDeltaDecoration[] = new Array<IModelDeltaDecoration>(cellFindMatch.contentMatches.length);
|
||||||
for (let i = 0; i < cellFindMatch.contentMatches.length; i++) {
|
for (let i = 0; i < cellFindMatch.contentMatches.length; i++) {
|
||||||
newFindMatchesDecorations[i] = {
|
newFindMatchesDecorations[i] = {
|
||||||
range: cellFindMatch.contentMatches[i].range,
|
range: cellFindMatch.contentMatches[i].range,
|
||||||
|
|
|
@ -735,8 +735,6 @@ export class FileMatch extends Disposable implements IFileMatch {
|
||||||
|
|
||||||
if (this._notebookEditorWidget) {
|
if (this._notebookEditorWidget) {
|
||||||
this._notebookUpdateScheduler.cancel();
|
this._notebookUpdateScheduler.cancel();
|
||||||
this._findMatchDecorationModel?.dispose();
|
|
||||||
this._findMatchDecorationModel = undefined;
|
|
||||||
this._editorWidgetListener?.dispose();
|
this._editorWidgetListener?.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1877,16 +1877,15 @@ export class SearchView extends ViewPane {
|
||||||
await elemParent.updateMatchesForEditorWidget();
|
await elemParent.updateMatchesForEditorWidget();
|
||||||
|
|
||||||
const matchIndex = oldParentMatches.findIndex(e => e.id() === element.id());
|
const matchIndex = oldParentMatches.findIndex(e => e.id() === element.id());
|
||||||
const matches = element.parent().matches();
|
const matches = elemParent.matches();
|
||||||
const match = matchIndex >= matches.length ? matches[matches.length - 1] : matches[matchIndex];
|
const match = matchIndex >= matches.length ? matches[matches.length - 1] : matches[matchIndex];
|
||||||
|
|
||||||
if (match instanceof MatchInNotebook) {
|
if (match instanceof MatchInNotebook) {
|
||||||
elemParent.showMatch(match);
|
elemParent.showMatch(match);
|
||||||
}
|
if (!this.tree.getFocus().includes(match) || !this.tree.getSelection().includes(match)) {
|
||||||
|
this.tree.setSelection([match], getSelectionKeyboardEvent());
|
||||||
if (!this.tree.getFocus().includes(match) || !this.tree.getSelection().includes(match)) {
|
this.tree.setFocus([match]);
|
||||||
this.tree.setSelection([match], getSelectionKeyboardEvent());
|
}
|
||||||
this.tree.setFocus([match]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue