Skip to content
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

alt+double-click to select multiple words with multiple cursors only selects to left of cursor #5366

Closed
ReedyBear opened this issue Oct 9, 2020 · 2 comments · Fixed by #5367

Comments

@ReedyBear
Copy link
Contributor

Describe the bug
Only selects to left of cursor when selecting second & subsequent words with multi-cursor

To Reproduce

  1. In insert mode. Click in the middle of a word
  2. [alt+double-click] on the same word but not on the cursor: Enters visual mode, the whole word is selected, and cursor is at the right end of the word
    • Note: [alt+double-click] directly on the cursor: does not enter visual mode (probably because it's not initiating multi-cursor?)
    • Note: double-click a word to select w/out alt does NOT enter visual mode
  3. [alt+double-click] the center of a different word: the 2nd word is selected from the cursor to the left & the 2nd cursor is at the left end of the second word
  4. Repeat Add ex mode #3 & same thing happens for add'l words

Expected behavior
Regarding step #2 notes: This issue is not about those notes, but I noticed them and thought it worth mentioning

Regarding step #3: The entire word I double click should be selected, with the cursor at the right-hand side, just as selecting the first word did.

Screenshots
PHTML is the first word I selected
multi-cursor-word-select

Environment (please complete the following information):

  • Issue Type: Bug
  • Extension Name: vim
  • Extension Version: 1.17.1
  • OS Version: Linux x64 5.8.13-200.fc32.x86_64
  • VSCode version: 1.49.3

Additional context
I first had this issue in 1.17.0. In 1.16, it remained in insert mode when double-clicking to select words. I also mentioned this problem in #5218 though... it's probably not worth reading through that issue as I've better captured the information here. From that thread, I think it's SUPPOSED to go into Visual Mode & that is an intended breaking change.

@ReedyBear
Copy link
Contributor Author

Regardless of how I select the first word (drag my cursor, double click w/out holding alt, alt+double-click directly on the existing cursor), [alt+double-click]ing the second word has the same behavior as described above.

@berknam
Copy link
Contributor

berknam commented Oct 9, 2020

@J-Fields I'm working on this one. I know what the problem is and have already fixed it but still want to test it more to make sure no other bugs are introduced. Will make a PR soon.

berknam added a commit to berknam/Vim that referenced this issue Oct 9, 2020
J-Fields pushed a commit that referenced this issue Oct 14, 2020
Fixes the selections with alt+double click not selecting the entire word. Only the first selection would work correctly.
Fixes #5366
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 a pull request may close this issue.

2 participants