@@ -34,6 +34,7 @@ import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor
34
34
import { TokenizationRegistry } from 'vs/editor/common/languages' ;
35
35
import { ColorId , ITokenPresentation } from 'vs/editor/common/encodedTokenAttributes' ;
36
36
import { Color } from 'vs/base/common/color' ;
37
+ import { TimeoutTimer } from 'vs/base/common/async' ;
37
38
38
39
export interface IVisibleRangeProvider {
39
40
visibleRangeForPosition ( position : Position ) : HorizontalPosition | null ;
@@ -112,6 +113,7 @@ export class TextAreaHandler extends ViewPart {
112
113
113
114
private _accessibilitySupport ! : AccessibilitySupport ;
114
115
private _accessibilityPageSize ! : number ;
116
+ private _accessibilityWriteTimer : TimeoutTimer ;
115
117
private _contentLeft : number ;
116
118
private _contentWidth : number ;
117
119
private _contentHeight : number ;
@@ -149,6 +151,7 @@ export class TextAreaHandler extends ViewPart {
149
151
const layoutInfo = options . get ( EditorOption . layoutInfo ) ;
150
152
151
153
this . _setAccessibilityOptions ( options ) ;
154
+ this . _accessibilityWriteTimer = this . _register ( new TimeoutTimer ( ) ) ;
152
155
this . _contentLeft = layoutInfo . contentLeft ;
153
156
this . _contentWidth = layoutInfo . contentWidth ;
154
157
this . _contentHeight = layoutInfo . height ;
@@ -575,7 +578,11 @@ export class TextAreaHandler extends ViewPart {
575
578
public override onCursorStateChanged ( e : viewEvents . ViewCursorStateChangedEvent ) : boolean {
576
579
this . _selections = e . selections . slice ( 0 ) ;
577
580
this . _modelSelections = e . modelSelections . slice ( 0 ) ;
578
- this . _textAreaInput . writeScreenReaderContent ( 'selection changed' ) ;
581
+ if ( this . _accessibilitySupport === AccessibilitySupport . Disabled ) {
582
+ this . _accessibilityWriteTimer . cancelAndSet ( ( ) => this . _textAreaInput . writeScreenReaderContent ( 'selection changed' ) , 0 ) ;
583
+ } else {
584
+ this . _textAreaInput . writeScreenReaderContent ( 'selection changed' ) ;
585
+ }
579
586
return true ;
580
587
}
581
588
public override onDecorationsChanged ( e : viewEvents . ViewDecorationsChangedEvent ) : boolean {
0 commit comments