Skip to content

Wrong cursor orientation after adding multi-cursor selection #9000

@musjj

Description

@musjj

Describe the bug
When using the editor.action.addSelectionTo{Next,Previous}FindMatch command, the direction/orientation of the selection is not taken into account.

So for example if you have selected the word foo, with the cursor on f, when you run addSelectionToNextFindMatch you will get a new selection with the cursor at o like this:

>|foo| # original selection

|foo|< # new selection

To Reproduce
settings.json

{
  "vim.visualModeKeyBindings": [
    {
      "before": ["g", "n"],
      "commands": ["editor.action.addSelectionToNextFindMatch"]
    },
    {
      "before": ["g", "N"],
      "commands": ["editor.action.addSelectionToPreviousFindMatch"]
    }
  ]
}

Expected behavior
I expect the orientation of the cursor to always match the original selection.

Environment (please complete the following information):

Extension version: 1.26.1
VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:34:12.840Z)
OS version: Linux x64 6.6.28

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions