File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/vs/workbench/contrib/accessibility/browser Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -296,11 +296,16 @@ export class AccessibleView extends Disposable {
296
296
if ( ! this . _codeBlocks ?. length || ! position ) {
297
297
return ;
298
298
}
299
- const codeBlockIndex = this . _codeBlocks . findIndex ( c => type === 'previous' ? c . endLine >= position . lineNumber : c . startLine > position . lineNumber ) ;
300
- if ( codeBlockIndex === - 1 ) {
299
+ let codeBlock ;
300
+ const codeBlocks = this . _codeBlocks . slice ( ) ;
301
+ if ( type === 'previous' ) {
302
+ codeBlock = codeBlocks . reverse ( ) . find ( c => c . endLine < position . lineNumber ) ;
303
+ } else {
304
+ codeBlock = codeBlocks . find ( c => c . startLine > position . lineNumber ) ;
305
+ }
306
+ if ( ! codeBlock ) {
301
307
return ;
302
308
}
303
- const codeBlock = this . _codeBlocks [ codeBlockIndex ] ;
304
309
this . setPosition ( new Position ( codeBlock . startLine , 1 ) , true ) ;
305
310
}
306
311
You can’t perform that action at this time.
0 commit comments