File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
notebook/browser/contrib/find Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ export class FindMatchDecorationModel extends Disposable {
114
114
115
115
const deltaDecorations : ICellModelDeltaDecorations [ ] = cellFindMatches . map ( cellFindMatch => {
116
116
// Find matches
117
- const newFindMatchesDecorations : IModelDeltaDecoration [ ] = new Array < IModelDeltaDecoration > ( cellFindMatch . length ) ;
117
+ const newFindMatchesDecorations : IModelDeltaDecoration [ ] = new Array < IModelDeltaDecoration > ( cellFindMatch . contentMatches . length ) ;
118
118
for ( let i = 0 ; i < cellFindMatch . contentMatches . length ; i ++ ) {
119
119
newFindMatchesDecorations [ i ] = {
120
120
range : cellFindMatch . contentMatches [ i ] . range ,
Original file line number Diff line number Diff line change @@ -735,8 +735,6 @@ export class FileMatch extends Disposable implements IFileMatch {
735
735
736
736
if ( this . _notebookEditorWidget ) {
737
737
this . _notebookUpdateScheduler . cancel ( ) ;
738
- this . _findMatchDecorationModel ?. dispose ( ) ;
739
- this . _findMatchDecorationModel = undefined ;
740
738
this . _editorWidgetListener ?. dispose ( ) ;
741
739
}
742
740
Original file line number Diff line number Diff line change @@ -1877,16 +1877,15 @@ export class SearchView extends ViewPane {
1877
1877
await elemParent . updateMatchesForEditorWidget ( ) ;
1878
1878
1879
1879
const matchIndex = oldParentMatches . findIndex ( e => e . id ( ) === element . id ( ) ) ;
1880
- const matches = element . parent ( ) . matches ( ) ;
1880
+ const matches = elemParent . matches ( ) ;
1881
1881
const match = matchIndex >= matches . length ? matches [ matches . length - 1 ] : matches [ matchIndex ] ;
1882
1882
1883
1883
if ( match instanceof MatchInNotebook ) {
1884
1884
elemParent . showMatch ( match ) ;
1885
- }
1886
-
1887
- if ( ! this . tree . getFocus ( ) . includes ( match ) || ! this . tree . getSelection ( ) . includes ( match ) ) {
1888
- this . tree . setSelection ( [ match ] , getSelectionKeyboardEvent ( ) ) ;
1889
- this . tree . setFocus ( [ match ] ) ;
1885
+ if ( ! this . tree . getFocus ( ) . includes ( match ) || ! this . tree . getSelection ( ) . includes ( match ) ) {
1886
+ this . tree . setSelection ( [ match ] , getSelectionKeyboardEvent ( ) ) ;
1887
+ this . tree . setFocus ( [ match ] ) ;
1888
+ }
1890
1889
}
1891
1890
}
1892
1891
}
You can’t perform that action at this time.
0 commit comments