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 => {
|
||||
// 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++) {
|
||||
newFindMatchesDecorations[i] = {
|
||||
range: cellFindMatch.contentMatches[i].range,
|
||||
|
|
|
@ -735,8 +735,6 @@ export class FileMatch extends Disposable implements IFileMatch {
|
|||
|
||||
if (this._notebookEditorWidget) {
|
||||
this._notebookUpdateScheduler.cancel();
|
||||
this._findMatchDecorationModel?.dispose();
|
||||
this._findMatchDecorationModel = undefined;
|
||||
this._editorWidgetListener?.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -1877,13 +1877,11 @@ export class SearchView extends ViewPane {
|
|||
await elemParent.updateMatchesForEditorWidget();
|
||||
|
||||
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];
|
||||
|
||||
if (match instanceof MatchInNotebook) {
|
||||
elemParent.showMatch(match);
|
||||
}
|
||||
|
||||
if (!this.tree.getFocus().includes(match) || !this.tree.getSelection().includes(match)) {
|
||||
this.tree.setSelection([match], getSelectionKeyboardEvent());
|
||||
this.tree.setFocus([match]);
|
||||
|
@ -1893,6 +1891,7 @@ export class SearchView extends ViewPane {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openEditorWithMultiCursor(element: FileMatchOrMatch): Promise<void> {
|
||||
const resource = element instanceof Match ? element.parent().resource : (<FileMatch>element).resource;
|
||||
|
|
Loading…
Reference in a new issue