@@ -34,7 +34,6 @@ import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor
3434import { TokenizationRegistry } from 'vs/editor/common/languages' ;
3535import { ColorId , ITokenPresentation } from 'vs/editor/common/encodedTokenAttributes' ;
3636import { Color } from 'vs/base/common/color' ;
37- import { TimeoutTimer } from 'vs/base/common/async' ;
3837import { IME } from 'vs/base/common/ime' ;
3938
4039export interface IVisibleRangeProvider {
@@ -114,7 +113,6 @@ export class TextAreaHandler extends ViewPart {
114113
115114 private _accessibilitySupport ! : AccessibilitySupport ;
116115 private _accessibilityPageSize ! : number ;
117- private _accessibilityWriteTimer : TimeoutTimer ;
118116 private _textAreaWrapping ! : boolean ;
119117 private _textAreaWidth ! : number ;
120118 private _contentLeft : number ;
@@ -154,7 +152,6 @@ export class TextAreaHandler extends ViewPart {
154152 const layoutInfo = options . get ( EditorOption . layoutInfo ) ;
155153
156154 this . _setAccessibilityOptions ( options ) ;
157- this . _accessibilityWriteTimer = this . _register ( new TimeoutTimer ( ) ) ;
158155 this . _contentLeft = layoutInfo . contentLeft ;
159156 this . _contentWidth = layoutInfo . contentWidth ;
160157 this . _contentHeight = layoutInfo . height ;
@@ -610,11 +607,9 @@ export class TextAreaHandler extends ViewPart {
610607 public override onCursorStateChanged ( e : viewEvents . ViewCursorStateChangedEvent ) : boolean {
611608 this . _selections = e . selections . slice ( 0 ) ;
612609 this . _modelSelections = e . modelSelections . slice ( 0 ) ;
613- if ( this . _accessibilitySupport === AccessibilitySupport . Disabled ) {
614- this . _accessibilityWriteTimer . cancelAndSet ( ( ) => this . _textAreaInput . writeScreenReaderContent ( 'selection changed' ) , 0 ) ;
615- } else {
616- this . _textAreaInput . writeScreenReaderContent ( 'selection changed' ) ;
617- }
610+ // We must update the <textarea> synchronously, otherwise long press IME on macos breaks.
611+ // See https://github.com/microsoft/vscode/issues/165821
612+ this . _textAreaInput . writeScreenReaderContent ( 'selection changed' ) ;
618613 return true ;
619614 }
620615 public override onDecorationsChanged ( e : viewEvents . ViewDecorationsChangedEvent ) : boolean {
0 commit comments