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

Autocomplete doesn't appear with multiple cursors #3282

Closed
jackfranklin opened this issue Dec 21, 2018 · 2 comments
Closed

Autocomplete doesn't appear with multiple cursors #3282

jackfranklin opened this issue Dec 21, 2018 · 2 comments

Comments

@jackfranklin
Copy link
Contributor

jackfranklin commented Dec 21, 2018

Describe the bug
When you have multiple cursors, the autocomplete doesn't appear. If I disable the Vim plugin, it does.

If you then hit Ctrl+Space to bring up the list, pressing Ctrl+n then moves through the list two at a time. I suspect this is because I have 2 cursors, so each Ctrl+n is registered twice.

To Reproduce
Steps to reproduce the behavior:

  1. Have some code that includes foo twice
  2. In normal mode, on the first foo, hit Cmd+D to select it + then the next one
  3. Notice that the autocomplete doesn't appear (bug 1)
  4. Hit Ctrl+Space to bring it up.
  5. Press Ctrl+n, and see that it skips through the list two at a time.

Note: I've tried this using Cmd+D and also gb to create the cursors.

Expected behavior

  1. The autocomplete appears as it would if I wasn't in a multiple cursor situation.
  2. ctrl+n goes through one at a time in all situations.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.17.0
  • VSCode version: 1.3.0
  • OS: OS X High Sierra
jackfranklin added a commit to jackfranklin/Vim that referenced this issue Dec 21, 2018
This fixes jumping the autocomplete options in multi cursors so that it
only jumps one at a time. Without this fix it jumps once _per cursor_,
so if I have 3 cursors, I am forced to traverse the list 3 at a time.

I initially found this as part of VSCodeVim#3282.
@jackfranklin
Copy link
Contributor Author

I did a bit more digging and found the issue with C-n and C-p, which the linked PR has a fix for.

For the first issue (the autocomplete not appearing automatically), I think it might have something to do with this code that changes how text insertions are created if you're in multi cursor mode:

      if (vimState.isMultiCursor) {
        vimState.recordedState.transformations.push({
          type: 'insertText',
          text: char,
          position: vimState.cursorPosition,
        });
      } else {
        vimState.recordedState.transformations.push({
          type: 'insertTextVSCode',
          text: char,
        });
      }

But my lack of familiarity with the code base is holding me back a bit - I'll keep trying to dig :)

jpoon pushed a commit that referenced this issue Feb 1, 2019
This fixes jumping the autocomplete options in multi cursors so that it
only jumps one at a time. Without this fix it jumps once _per cursor_,
so if I have 3 cursors, I am forced to traverse the list 3 at a time.

I initially found this as part of #3282.
@J-Fields
Copy link
Member

Seems this was fixed by #3283, so closing it out

@J-Fields J-Fields added the status/already-resolved Fixed in previous version label Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants