Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@hron
Copy link
Contributor

@hron hron commented Aug 10, 2024

When Merge Editor's actions are assigned to keyboard like this:

[
    {
        "key": "ctrl+g a",
        "command": "merge.toggleActiveConflictInput1",
        "when": "isMergeEditor"
    },
    {
        "key": "ctrl+g b",
        "command": "merge.toggleActiveConflictInput2",
        "when": "isMergeEditor"
    },
    {
        "key": "ctrl+g ctrl+a",
        "command": "merge.acceptAllInput1",
        "when": "isMergeEditor"
    },
    {
        "key": "ctrl+g ctrl+b",
        "command": "merge.acceptAllInput2",
        "when": "isMergeEditor"
    },
]

Any of such action changes the state of the merged editor so diff range becomes locked, i.e. even if a cursor is moved to another diff range the actions target the locked one. If focus is changed the merge editor returns to a normal state. This behavior is only reproducible if all the actions are performed with keyboard because mouse clicking and calling the actions from the command pallette changes the focus and everything works correctly.

Fixes #225319

merge-editor-fix-after.webm

When Merge Editor's actions are assigned to keyboard like this:

```json
[
    {
        "key": "ctrl+g a",
        "command": "merge.toggleActiveConflictInput1",
        "when": "isMergeEditor"
    },
    {
        "key": "ctrl+g b",
        "command": "merge.toggleActiveConflictInput2",
        "when": "isMergeEditor"
    },
    {
        "key": "ctrl+g ctrl+a",
        "command": "merge.acceptAllInput1",
        "when": "isMergeEditor"
    },
    {
        "key": "ctrl+g ctrl+b",
        "command": "merge.acceptAllInput2",
        "when": "isMergeEditor"
    },
]
```

Any of such action changes the state of the merged editor so diff range
becomes locked, i.e. even if a cursor is moved to another diff range the
actions target the locked one. If focus is changed the merge editor
returns to a normal state. This behavior is only reproducible if all the
actions are performed with keyboard because mouse clicking and calling
the actions from the command pallette changes the focus and everything
works correctly.

Fixes microsoft#225319
@hron hron force-pushed the fix-merge-editor-go-to-conflict branch from 6951df1 to 58095aa Compare August 10, 2024 15:36
@hediet hediet enabled auto-merge (squash) August 12, 2024 12:46
@hediet
Copy link
Member

hediet commented Aug 12, 2024

Thanks!

@hediet hediet added this to the August 2024 milestone Aug 12, 2024
@hediet hediet merged commit 1b401f6 into microsoft:main Aug 12, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge Editor commands works incorrectly when called via keyboard

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.