Skip to content

Conversation

@tamuratak
Copy link
Contributor

Ignore Enter for replace while composing (add isComposing precondition). Fix #257776.

Similar to #174829

Copilot AI review requested due to automatic review settings October 27, 2025 00:06
Copy link
Contributor

Copilot AI left a 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 isComposing precondition to the replace command's keyboard binding expression to prevent premature activation during IME composition.

Copy link
Contributor

@osortega osortega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ✨

@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 10, 2025
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()),
Copy link
Member

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

Copy link
Contributor

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

this.isComposingGlobalContextKey = contextKeyService.createKey('isComposing', false);

But it was never added to EditorContextKeys
@tamuratak could you make sure we use is there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pressing Enter to confirm IME composition in Search/Replace widget also triggers the replace action

3 participants