Skip to content

Commit

Permalink
WIP: Fixes double-match problem, breaks no-match case
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonWeill committed May 3, 2024
1 parent c59ac31 commit af9bcf5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/notebook/src/searchprovider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,19 @@ export class NotebookSearchProvider extends SearchProvider<NotebookPanel> {
if (
from !== 'previous-match' ||
!atEndOfCurrentCell ||
this._currentProviderIndex + 1 < this._searchProviders.length
(!loop && this._currentProviderIndex + 1 < this._searchProviders.length)
) {
const startIndex = this._currentProviderIndex;
this._currentProviderIndex += atEndOfCurrentCell ? 1 : 0;
// If we're at the end of the last cell in the provider list and we need to loop, do so
if (
loop &&
atEndOfCurrentCell &&
this._currentProviderIndex + 1 >= this._searchProviders.length
) {
this._currentProviderIndex = 0;
} else {
this._currentProviderIndex += atEndOfCurrentCell ? 1 : 0;
}
do {
const searchEngine = this._searchProviders[this._currentProviderIndex];

Expand Down

0 comments on commit af9bcf5

Please sign in to comment.