Skip to content

Commit 1d30210

Browse files
authored
Revert "Call composition type handler when doing composition" (microsoft#251902)
Revert "Call composition type handler when doing composition (microsoft#251821)" This reverts commit 57d591d.
1 parent d0ad23a commit 1d30210

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/vs/editor/browser/controller/editContext/native/nativeEditContext.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class NativeEditContext extends AbstractEditContext {
6161
private _parent: HTMLElement | undefined;
6262
private _decorations: string[] = [];
6363
private _primarySelection: Selection = new Selection(1, 1, 1, 1);
64-
private _isComposing: boolean = false;
64+
6565

6666
private _targetWindowId: number = -1;
6767
private _scrollTop: number = 0;
@@ -185,15 +185,13 @@ export class NativeEditContext extends AbstractEditContext {
185185
this._emitTypeEvent(this._viewController, e);
186186
}));
187187
this._register(editContextAddDisposableListener(this._editContext, 'compositionstart', (e) => {
188-
this._isComposing = true;
189188
// Utlimately fires onDidCompositionStart() on the editor to notify for example suggest model of composition state
190189
// Updates the composition state of the cursor controller which determines behavior of typing with interceptors
191190
this._viewController.compositionStart();
192191
// Emits ViewCompositionStartEvent which can be depended on by ViewEventHandlers
193192
this._context.viewModel.onCompositionStart();
194193
}));
195194
this._register(editContextAddDisposableListener(this._editContext, 'compositionend', (e) => {
196-
this._isComposing = false;
197195
// Utlimately fires compositionEnd() on the editor to notify for example suggest model of composition state
198196
// Updates the composition state of the cursor controller which determines behavior of typing with interceptors
199197
this._viewController.compositionEnd();
@@ -408,7 +406,7 @@ export class NativeEditContext extends AbstractEditContext {
408406
}
409407

410408
private _onType(viewController: ViewController, typeInput: ITypeData): void {
411-
if (typeInput.replacePrevCharCnt || typeInput.replaceNextCharCnt || typeInput.positionDelta || this._isComposing) {
409+
if (typeInput.replacePrevCharCnt || typeInput.replaceNextCharCnt || typeInput.positionDelta) {
412410
viewController.compositionType(typeInput.text, typeInput.replacePrevCharCnt, typeInput.replaceNextCharCnt, typeInput.positionDelta);
413411
} else {
414412
viewController.type(typeInput.text);

src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,8 +1861,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
18611861
},
18621862
compositionType: (text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number) => {
18631863
// Try if possible to go through the existing `replacePreviousChar` command
1864-
const editContextEnabled = this.getOption(EditorOption.effectiveEditContext);
1865-
if (replaceNextCharCnt || positionDelta || editContextEnabled) {
1864+
if (replaceNextCharCnt || positionDelta) {
18661865
// must be handled through the new command
18671866
const payload: editorCommon.CompositionTypePayload = { text, replacePrevCharCnt, replaceNextCharCnt, positionDelta };
18681867
this._commandService.executeCommand(editorCommon.Handler.CompositionType, payload);

0 commit comments

Comments
 (0)