Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Fix a first character problem in IME with autoClosingPairs.enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ackey authored and bryphe committed Jun 21, 2018
1 parent 7ebdfea commit 633d838
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion browser/src/UI/Shell/ShellView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,16 @@ export class ShellView extends React.PureComponent<IShellViewComponentProps, ISh
}

private _onRootKeyDown(evt: React.KeyboardEvent<HTMLElement>): void {
// onCompositionStart can't detect composing mode for the first character
// because it is fired after onKeyDown.
// keyCode is deprecated but it seems this is the only method to detect
// composing mode for the first character for now.
let isComposing = false
if (evt.keyCode === 229) {
isComposing = true
}
const vimKey = inputManager.resolvers.resolveKeyEvent(evt.nativeEvent)
if (!this.state.isComposing && inputManager.handleKey(vimKey)) {
if (!this.state.isComposing && !isComposing && inputManager.handleKey(vimKey)) {
evt.stopPropagation()
evt.preventDefault()
} else {
Expand Down

0 comments on commit 633d838

Please sign in to comment.