TabNine icon indicating copy to clipboard operation
TabNine copied to clipboard

Inline Completions Set Visual Mode on Vim

Open matthew-plusprogramming opened this issue 2 years ago • 7 comments

please complete the following information:

  • OS version: Win 10 WSL
  • Editor: vscode
  • Editor version:
  • Programming language: ts
  • TabNine extension version: 3.5.11
  • Engine version (could be located within Tabnine Hub): 4.0.37-39

Issue Details: Whenever I hit tab on an inline completion, it turns my VSCode vim mode from Normal to Visual requiring me to hit esc multiple times to start editing again. This issue has been cited by many individuals in many different instances. The conflicting extension is also very widespread within the vscode community with over 3,000,000 downloads.

Conflicting Extension: https://marketplace.visualstudio.com/items?itemName=vscodevim.vim

gz#10247

matthew-plusprogramming avatar Dec 22 '21 21:12 matthew-plusprogramming

Other cited instances:

it seems will quit edit mode and turn to visual mode with vsocde vim in some cases Originally posted by @xuzhanhh in https://github.com/codota/TabNine/issues/432#issuecomment-904526849

same for me, but almost all time Originally posted by @lastgosumatt in https://github.com/codota/TabNine/issues/432#issuecomment-906199227

Yes, almost all the time here too. Originally posted by @Mattiaslndstrm in https://github.com/codota/TabNine/issues/432#issuecomment-906377070

What I personally noticed is that the inline completetions aren't really compatible with the vscode vim plugin (vscodevim.vim). When using a suggested completion by pressing tab, the vim plugin will go into visual mode, the vim cursor stays at the last typed character but a "normal", thin cursor will appear at the end of the completed code. This is quite an annoyance as you can't keep typing but instead need to spam esc to get back into normal mode and then move your cursor to the end again and go into insert mode before you can start typing again. Originally posted by @hugohabicht01 in https://github.com/codota/TabNine/issues/432#issuecomment-908231878

Same here Originally posted by @AliXEagle in https://github.com/codota/TabNine/issues/432#issuecomment-930157331

matthew-plusprogramming avatar Dec 22 '21 21:12 matthew-plusprogramming

Hi! We received a few complaints regarding this error, and it is being fixed now by our developers. Once a fix is released, we will update at https://github.com/codota/TabNine/issues/432

maya-tabnine avatar Jan 03 '22 09:01 maya-tabnine

This is a temporary workaround: https://github.com/codota/TabNine/issues/432#issuecomment-1064936875

Make sure to install the multi-command extension

matthew-plusprogramming avatar Apr 29 '22 05:04 matthew-plusprogramming

Hey @matthew-plusprogramming, We just released a fix for this issue with version 3.5.49. We'd appreciate it if you could try it out and let us know what you think.

LeshemNoa avatar May 22 '22 13:05 LeshemNoa

On an unrelated issue, my tabnine is constantly glitching out vscode which is making it unusable. Whenever I start typing, the cursor starts jumping around and deleting random text. This occurs with or without the vim extension enabled

matthew-plusprogramming avatar Jun 06 '22 03:06 matthew-plusprogramming

Hey @matthew-plusprogramming, We just released a fix for this issue with version 3.5.49. We'd appreciate it if you could try it out and let us know what you think.

I use the version of 3.6.14 which has the exact same issue.

milesxu avatar Sep 02 '22 09:09 milesxu

I use the version of 3.6.14 which has the exact same issue.

Same problem.

JoabBelmont avatar Sep 10 '22 16:09 JoabBelmont

3.6.15 still has this issue in VSCode

drye avatar Oct 04 '22 10:10 drye

Hey @matthew-plusprogramming, We just released a fix for this issue with version 3.5.49. We'd appreciate it if you could try it out and let us know what you think.

still have the issue, when using Tabnine in ssh remote, and vim in local editor

wl-junlin avatar Oct 26 '22 06:10 wl-junlin

I use the version of 3.6.14 which has the exact same issue.

Same problem.

Same problem.

hiber-niu avatar Dec 14 '22 13:12 hiber-niu

v3.6.31 still has this issue.

VictorBelikov avatar Dec 17 '22 17:12 VictorBelikov

TabNine closes the autosuggestion widget by triggering the escape key, so it also goes out of Vim's insert mode. Add this to your keybindings.json to disable it:

{
        "key": "tab",
        "command": "-tabnine.tab-override",
        "when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && tabnine.tab-override && textInputFocus"
},

gldanoob avatar Jan 11 '23 02:01 gldanoob

Any update on this issue?

tommdq avatar Jan 28 '23 17:01 tommdq

I was having the same problem and I tried the solution #432 (comment) but with no results. So I modified it to the following and added them to keybinding.json, which worked for me.

{
    "key": "tab",
    "command": "extension.multiCommand.execute",
    "args": {
      "sequence": [
        "toggleVim",
        "tabnine.tab-override",
        "toggleVim",
        "extension.vim_insert",
      ],
      "interval": 50, 
    },
    "when": "vim.active && suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && tabnine.tab-override && textInputFocus"
},
{
    "key": "tab",
    "command": "-tabnine.tab-override",
    "when": "vim.active && suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && tabnine.tab-override && textInputFocus"
},

Note that the multi-command extension is required.

Hope it helps!

ZhenWZ avatar Mar 12 '23 07:03 ZhenWZ

I was having the same problem and I tried the solution #432 (comment) but with no results. So I modified it to the following and added them to keybinding.json, which worked for me.

{
    "key": "tab",
    "command": "extension.multiCommand.execute",
    "args": {
      "sequence": [
        "toggleVim",
        "tabnine.tab-override",
        "toggleVim",
        "extension.vim_insert",
      ],
      "interval": 50, 
    },
    "when": "vim.active && suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && tabnine.tab-override && textInputFocus"
},
{
    "key": "tab",
    "command": "-tabnine.tab-override",
    "when": "vim.active && suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && tabnine.tab-override && textInputFocus"
},

Note that the multi-command extension is required.

Hope it helps!

Thanks! It worked.

paulopicasso avatar Apr 03 '23 11:04 paulopicasso

I was having the same problem and I tried the solution #432 (comment) but with no results. So I modified it to the following and added them to keybinding.json, which worked for me.

{
    "key": "tab",
    "command": "extension.multiCommand.execute",
    "args": {
      "sequence": [
        "toggleVim",
        "tabnine.tab-override",
        "toggleVim",
        "extension.vim_insert",
      ],
      "interval": 50, 
    },
    "when": "vim.active && suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && tabnine.tab-override && textInputFocus"
},
{
    "key": "tab",
    "command": "-tabnine.tab-override",
    "when": "vim.active && suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && tabnine.tab-override && textInputFocus"
},

Note that the multi-command extension is required.

Hope it helps!

Thanks, this worked for me.

alghenab avatar May 10 '23 09:05 alghenab

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 09 '23 10:07 stale[bot]