Skip to content

Commit

Permalink
Merge pull request #7835 from marisaaquilina/jump-issue
Browse files Browse the repository at this point in the history
Fix unexpected jump to last search result when using documentsearch
  • Loading branch information
Steven Silvester committed Jan 30, 2020
2 parents c443c24 + a0d234a commit 4be1eb1
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/documentsearch/src/providers/notebooksearchprovider.ts
Expand Up @@ -60,15 +60,10 @@ export class NotebookSearchProvider implements ISearchProvider<NotebookPanel> {
this._searchTarget = searchTarget;
const cells = this._searchTarget.content.widgets;

this._query = query;
this._filters =
!filters || Object.entries(filters).length === 0
? { output: true }
: filters;
// Listen for cell model change to redo the search in case of
// new/pasted/deleted cells
const cellList = this._searchTarget.model!.cells;
cellList.changed.connect(this._restartQuery.bind(this), this);

// hide the current notebook widget to prevent expensive layout re-calculation operations
this._searchTarget.hide();
Expand Down Expand Up @@ -461,12 +456,6 @@ export class NotebookSearchProvider implements ISearchProvider<NotebookPanel> {
return match;
}

private async _restartQuery() {
await this.endQuery();
await this.startQuery(this._query, this._searchTarget!, this._filters);
this._changed.emit(undefined);
}

private _getMatchesFromCells(): ISearchMatch[][] {
let indexTotal = 0;
const result: ISearchMatch[][] = [];
Expand Down Expand Up @@ -503,7 +492,6 @@ export class NotebookSearchProvider implements ISearchProvider<NotebookPanel> {
}

private _searchTarget: NotebookPanel | undefined | null;
private _query: RegExp;
private _filters: INotebookFilters;
private _searchProviders: ICellSearchPair[] = [];
private _currentProvider: ICellSearchPair | null | undefined;
Expand Down

0 comments on commit 4be1eb1

Please sign in to comment.