Vim: Pressing tab in insert-mode inserts the string `<tab>`

Created on 7 Sep 2016  路  31Comments  路  Source: VSCodeVim/Vim

What did you do?

Put the exact keys you pressed. i[TAB]

What did you expect to happen?

I expected the two spaces I have configured to be inserted.

What happened instead?

The string <tab> was inserted.

Technical details:

Running ionide-fsharp, latest version

  • VSCode Version: 1.4.0
  • VsCodeVim Version: latest, updated today
  • OS: OS X 10.11.6

screen shot 2016-09-07 at 09 57 19

screen shot 2016-09-07 at 09 24 14

areperformance help wanted kinbug

Most helpful comment

This one is driving me crazy.

A quick fix toggle insert mode on and off.

All 31 comments

I unfortunately can't repro this on v0.1.10 (latest). Does this happen on a new file? Can you share your user/workspace settings?

It happens once in a while when code is struggling to keep up with my typing and F# intellisense is also struggling to keep up and compile everything. Most of the time it works fine.

My settings:

{
  "editor.fontSize": 12,
  "editor.tabSize": 2,
  // Inserting and deleting whitespace follows tab stops
  "editor.renderWhitespace": true,
  "FSharp.linter": false,
  "editor.useTabStops": true,
  "telemetry.enableTelemetry": false,
  "telemetry.enableCrashReporter": false,
  "window.zoomLevel": -1,
  "search.exclude": {
    "**/node_modules": true,
    "**/build": true,
    "**/bower_components": true
  }
}

Is it a race condition while we handing the type event? I'd like to keep an eye on this issue as seems it has something to do with Code internal type

I can actually reproduce this trivially just by going into insert mode and holding down tab.

@johnfn any repro steps with env/config as I can't make it happen on my machine.

@rebornix osx 10.10.5, vsc insiders on latest, plugins: tslint, relative path, debugger for chrome, vim (though i doubt any of those other than vim are relevant).

I can troubleshoot this one when I have the time.

settings.json:

``````
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": [""]
}
],

"vim.hlsearch": false,

"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
"editor.tabSize": 2,
"editor.insertSpaces": true,
"vim.useCtrlKeys": true,
"files.trimTrailingWhitespace": true

}```
``````

I also can't repro this on my machine.
Maybe the culprit is https://github.com/ionide/ionide-vscode-fsharp?

It happens in other files than F# ones.

@haf does it happen consistently on your machine? Still looking for a consistent repro.

@jpoon No, it's not consistent.

Today this bug also happened to me while I was working on VSCode.

Specifically, I noticed I have a watch compile, and this happened when I entered insert mode before re-compilation is done.

I can't repro is consistently, though.

Not sure but maybe it's related to https://github.com/VSCodeVim/Vim/issues/771

Since we significantly changed the behavior of special keys, I'd like to close this issue first as I don't see this in current master bits. Anyone can reopen it if running into it again with our next version.

Yep, can't repro this one any more. :)

Thank you!!!

This needs to be reopened, since it's still an issue.

screen shot 2017-05-13 at 19 44 09

@haf do you have a repro? Or is it random?

It's random.

@haf Do you notice it happening in any particular scenario? Or does it just happen randomly in insert mode?

It only happens when I push the editor via other extensions. So eg if Ionide is compiling my f# after a change and there is a bit lag in vscode then it happens much more often

This bug also happens in search mode. Typing / tab inserts and searches for <tab> string instead of \t. Same thing with / ctrl+v tab sequence.

It also happen to me.

  • VSCode Version: Code - Insiders 1.20.0-insider (f4ed56b0d61050f6a94cfa033a058fabfdc0d651, 2018-01-09T06:08:10.994Z)
  • OS Version: Darwin x64 17.3.0
  • Extensions (12) Extension|Author (truncated)|Version ---|---|--- beautify|Hoo|1.1.1 gitlens|eam|7.2.0 auto-close-tag|for|0.5.5 auto-complete-tag|for|0.0.2 auto-rename-tag|for|0.0.15 recent-files|jun|1.1.9 endwise|kai|1.2.2 code-beautifier|mic|1.7.2 color-highlight|nau|2.3.0 Ruby|reb|0.15.0 vim|vsc|0.10.8 local-history|xyz|1.6.2 (1 theme extensions excluded)

I got same problem:

Version 1.19.1
Commit 0759f77bb8d86658bc935a10a64f6182c5a1eeba
Date 2017-12-19T09:41:01.414Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Reloading vim only help temporarily

This one is driving me crazy.

A quick fix toggle insert mode on and off.

The steps to trigger the issue are mentioned in https://github.com/VSCodeVim/Vim/issues/1195

I always use split mode like the people in linked issue.

Maybe the fix was removed accidentally?

Thanks @philipmclifton for linking the history. Helped with debugging.

Is it possible this has come back in a new version of the plugin? It has occurred a few times for me in the past week.

Have two tabs open. Open another file. Close the file. Press tab.

https://www.icloud.com/iclouddrive/0m6znnqxbbBAcItbaMd1_i-BA#tab-issue

^^ Video of issue happening.

I was able to reproduce similar to the video @philipmclifton, thanks for the video. I'll try to take a look this weekend.

I'm not sure if it could have re-emerged. There is a chance #3090 could affect the issue, which was merged and might be released this evening. It isn't the same issue fixed, but I can see how it could be relevant if there is some sort of remapping of <Tab>.

This regression can be discussed in #3096.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

AndersenJ picture AndersenJ  路  3Comments

ACollectionOfAtoms picture ACollectionOfAtoms  路  3Comments

liamdawson picture liamdawson  路  3Comments

st-schneider picture st-schneider  路  3Comments