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

Inserting a Hash/Number/Pound sign writes out "X\x08#" instead #4387

Closed
mitsuhiko opened this issue Dec 16, 2019 · 13 comments
Closed

Inserting a Hash/Number/Pound sign writes out "X\x08#" instead #4387

mitsuhiko opened this issue Dec 16, 2019 · 13 comments

Comments

@mitsuhiko
Copy link

Describe the bug

When one tries to write # VScode will write out X\x08# into the file instead (note that \x08 is the backspace character). Not sure when it regressed but it happened some time last week for me the first time.

To Reproduce
Steps to reproduce the behavior:

  1. Switch to insert mode
  2. Write #
  3. See X# in the buffer, deleting # places you behind an invisible backspace character.

Expected behavior
Just having # written.

Screenshots
image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.12.2
  • VSCode version: 1.41.0 (9579eda04fdb3a9bba2750f15193e5fafe16b959)
  • OS: Darwin x64 18.7.0
@J-Fields
Copy link
Member

Unable to reproduce on Windows 10

@faulkner
Copy link

The bug appears to have been introduced in 1.12.1 (downgrading to 1.12.0 fixes the issue for me).

@nfm
Copy link

nfm commented Dec 20, 2019

I'm also experiencing this regression.

Environment:

  • Extension (VsCodeVim) version: 1.12.2
  • VSCode version: Version: 1.41.1 (26076a4de974ead31f97692a0d32f90d735645c0)
  • OS: Linux x64 5.3.0-24-generic

Happy to help debug this issue, let me know if there's anything I can test out or more info I can provide that would be useful ❤️

@mitsuhiko
Copy link
Author

I can confirm that I can't reproduce it on windows but I can on mac. Not sure if there is anything else I can help here. I had to downgrade to 1.11.13 which is the last plugin that works on mac for me.

@mitsuhiko mitsuhiko reopened this Dec 20, 2019
@mitsuhiko
Copy link
Author

Since I just got auto updated: confirmed still broken on 1.12.3.

@nfm
Copy link

nfm commented Dec 28, 2019

I've just updated to 1.12.4 and it appears this is resolved for me now 👍

@J-Fields
Copy link
Member

@nfm Sweet. Nothing was done to directly fix this, so my hunch is vim.vimrc.enable being true by default was causing some issue. Would you mind turning it back on and seeing if you can reproduce this bug again?

@mitsuhiko
Copy link
Author

Likely to be the cause. I can't test this right now but by vimrc like the one of many others has this in it: inoremap # X^H#. This is a hack to make smartindent not outdent hashes.

@J-Fields
Copy link
Member

Yup, sounds like the culprit. I'm not too familiar with this - should VSCodeVim behave differently than it does with that remap? Or is this really just vim-specific, and we should have some way of ignoring certain remaps?

@mitsuhiko
Copy link
Author

It should definitely not insert a backspace ascii char but delete the last char. That’s how vim behaves.

@J-Fields
Copy link
Member

Oh right, I'd forgotten about what ^H did in insert mode. Would you mind filing a new issue describing the remap misbehavior?

@nfm
Copy link

nfm commented Dec 29, 2019

Nice sleuthing all 🙇‍♂️

My init.vim does contain inoremap # X^H#.

I can confirm that if I set "vim.vimrc.path": "~/.config/nvim/init.vim", "vim.vimrc.enable": true then the errant behaviour reproduces under 1.12.4.

The remap is unnecessary in VSCode, it's just a workaround required for vim/neovim. Some way to ignore certain remaps could be nice, but isn't super important to me at least.

@mitsuhiko
Copy link
Author

Created #4430. Closing this one as resolved.

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

4 participants