-
Notifications
You must be signed in to change notification settings - Fork 36.6k
Ignore Enter for replace while composing. Fix #257776 #273452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where pressing Enter during IME composition in the find/replace widget would trigger the replace action prematurely. The fix adds an isComposing precondition to prevent Enter from executing the replace command while text is being composed.
Key Changes:
- Added
isComposingprecondition to the replace command's keyboard binding expression to prevent premature activation during IME composition.
osortega
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you ✨
| kbOpts: { | ||
| weight: KeybindingWeight.EditorContrib + 5, | ||
| kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_REPLACE_INPUT_FOCUSED), | ||
| kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_REPLACE_INPUT_FOCUSED, EditorContextKeys.isComposing.negate()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This context key is never used so it doesn't do anything? Am I missing someting? @osortega
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we are creating it here
vscode/src/vs/workbench/services/keybinding/browser/keybindingService.ts
Lines 202 to 203 in 541da45
| this.isComposingGlobalContextKey = contextKeyService.createKey('isComposing', false); | |
But it was never added to EditorContextKeys
@tamuratak could you make sure we use is there?
Ignore Enter for replace while composing (add isComposing precondition). Fix #257776.
Similar to #174829