microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.19k stars 29.29k forks source link

Merge Editor commands works incorrectly when called via keyboard #225319

Closed hron closed 2 months ago

hron commented 3 months ago

Type: Bug

  1. Assign the following keyboard shortctus:
    [
    {
        "key": "ctrl+g a",
        "command": "merge.toggleActiveConflictInput1",
        "when": "isMergeEditor"
    },
    {
        "key": "ctrl+g b",
        "command": "merge.toggleActiveConflictInput2",
        "when": "isMergeEditor"
    }
    ]
  2. Start rebasing of a branch on another to produce merge conflicts
  3. Open a merge editor
  4. Go to the first diff and accept current changes via Ctrl+g a
  5. Move cursor to the next diff via keyboard

Expected behavior:

The next diff range should become active and all the subsequent actions like ctrl+g a or ctrl+g b should be applied on the second diff range because it is under the cursor.

Actual behavior:

The first diff range becomes "locked" and all the actions are applied to it. If the focus is changed by click with mouse or by changing the current window via Alt-Tab Merge Editor starts behaves correctly until next action like merge.toggleActiveConflictInput*

merge-editor-fix-before.webm

VS Code version: Code 1.92.0 (b1c0a14de1414fcdaa400695b4db1c0799bc3124, 2024-07-31T23:26:45.634Z) OS version: Linux x64 6.8.0-39-generic Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700H (20 x 3200)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|62.54GB (38.12GB free)| |Process Argv|/home/algus/src/vscode --crash-reporter-id 45d3dad3-5e71-4e55-9ad0-d23cc2852df1| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|wayland|
Extensions (58) Extension|Author (truncated)|Version ---|---|--- rust-bundle|1Yi|1.0.0 Bookmarks|ale|13.5.0 jsonl|Alp|0.0.1 aws-toolkit-vscode|ama|3.19.0 mocha-snippets|and|1.2.0 jest-snippets|and|1.9.1 test-switcher|bma|2.6.3 vscode-intelephense-client|bme|1.12.2 scratchpads|bue|1.0.0 vscode-eslint|dba|3.0.10 rust-syntax|dus|0.6.1 gitlens|eam|15.2.3 EditorConfig|Edi|0.16.4 vscode-great-icons|emm|2.1.105 prettier-vscode|esb|10.4.0 dependi|fil|0.7.7 copilot|Git|1.221.0 copilot-chat|Git|0.18.1 gitlab-workflow|Git|5.4.0 terraform|has|2.32.2 search-editor-apply-changes|jak|0.1.1 nix-ide|jno|0.3.3 center-editor-window|kai|2.3.0 vscode-cfn-lint|kdd|0.25.6 graphql-for-vscode|kum|1.15.3 Lisp|mat|0.1.12 dotenv|mik|1.0.1 direnv|mkh|0.17.0 shfmt|mkh|1.3.1 vscode-docker|ms-|1.29.1 isort|ms-|2023.10.1 python|ms-|2024.12.2 jupyter|ms-|2024.7.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.19 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-containers|ms-|0.380.0 makefile-tools|ms-|0.9.10 test-adapter-converter|ms-|0.1.9 vscode-github-issue-notebooks|ms-|0.0.130 vsliveshare|ms-|1.0.5936 sqltools|mtx|0.28.3 sqltools-driver-pg|mtx|0.5.4 angular-console|nrw|18.25.0 material-icon-theme|PKi|5.8.0 vscode-yaml|red|1.15.0 rust-analyzer|rus|0.3.2062 ruby-lsp|Sho|0.7.14 code-spell-checker|str|3.0.1 code-spell-checker-finnish|str|1.0.0 code-spell-checker-russian|str|2.2.2 even-better-toml|tam|0.19.2 shellcheck|tim|0.37.1 vscode-lldb|vad|1.10.0 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 php-debug|xde|1.35.0 (8 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 945dj816:31013170 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31111718 wkspc-ranged-t:31111713 ```
vs-code-engineering[bot] commented 3 months ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.92.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!