vscode-neovim icon indicating copy to clipboard operation
vscode-neovim copied to clipboard

Rendering random characters

Open kwsp opened this issue 3 years ago • 3 comments

Random characters are sometimes rendered in place of true characters (the code is still correct when I run it, but doesn't display correctly). If I highlight the wrongly displayed characters and then unhighlight, the error corrects itself. It's really random when it happens and I don't know how best to reproduce it. However, this has happened on two of my machines running Windows 10 and 11.

Rendered wrong: image True text: image

Rendered wrong: image True text: image

  • VS Code Version:
1.68.1
30d9c6cd9483b2cc586687151bcbcd635f373630
x64

-VSCode Neovim Version: v0.0.87

  • OS Version:
Edition	Windows 10 Pro
Version	21H2
Installed on	‎3/‎19/‎2021
OS build	19044.1766
Experience	Windows Feature Experience Pack 120.2212.4180.0

Steps to Reproduce:

  1. Open a python file in VS Code with the "VSCode Neovim" extension
  2. Write code for a while, then random characters will be rendered in place of true characters.

https://github.com/microsoft/vscode/issues/154565

kwsp avatar Jul 11 '22 04:07 kwsp

I think this is caused by bugs in the extmark-overlay PR.

theol0403 avatar Jul 11 '22 18:07 theol0403

For reference, having the same issue with VS Code version:

1.69.1
b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a
x64

Possible duplicate of #966

jesseli2002 avatar Jul 12 '22 23:07 jesseli2002

I also do have some strange behavior. VSCode: v1.69.2 VSCode Neovim: v0.0.88

When i'm in normal mode, everything is fine image

When i start entering text, a charcter is shown in front of the cursor (Sometimes it also replaces the closing bracket and added another bracket) image

suntsu42 avatar Jul 27 '22 13:07 suntsu42

Same occurs when undoing sometimes:

image `ci{` image `u` image

EDIT: I've reverted to version 0.0.84 and don't see this issue there.

lmapii avatar Oct 06 '22 13:10 lmapii

not sure whether it's related, but I still have the messed up display even in version 0.0.85

this sometimes happens in visual mode:

image

dnguyenzd avatar Oct 06 '22 21:10 dnguyenzd

Yeah I've had to go back to a higher version as well (since in 0.0.84 the visual mode doesn't work nicely) and there the random characters come back, which makes it kind of unusable since it includes quotes etc., so you're never really sure what the state of the buffer is.

lmapii avatar Oct 07 '22 05:10 lmapii

This is what it looks when i go to input mode and enter "//some comment" Version v0.0.89

2022-10-07_07-29-46

I don't have this behavior when i'm using version v0.0.84

suntsu42 avatar Oct 07 '22 05:10 suntsu42

I have graphical glitches happening when doing %s/foo/bar replace and then undo the change. Has happened in other scenarios as well, but don't remember what they are anymore.

Verified that this issue isn't there with v0.0.84 and it is there with v.0.0.85

EDIT: Example of this happening: image What it should look like: image

erlais avatar Nov 03 '22 11:11 erlais

Can confirm the behavior same as @erlais, see the attached screenshot, I have an extra 1 appearing to the left 16 corresponding to num_nodes, the glitch goes away if I go down to v0.0.84

the characters go away if I run the no-highlight command (:noh)

image

abhiskk avatar Nov 03 '22 23:11 abhiskk

hi @theol0403, @windwp

I reverted the changes from #868 and it resolves the rendering issues I was facing, of course this makes lightspeed unusable with vscode. I have a fork which has the reverted changes, do you have any suggestions on how can I go about fixing this properly?

abhiskk avatar Nov 06 '22 18:11 abhiskk

I still can't reproduce this issue. it will better if someone can send a file and a specify step to reproduce you can try this PR #1075 but i am not sure.

windwp avatar Nov 07 '22 14:11 windwp

Hi, I am experiencing this issue as well with Version 1.73 of VSCode and neovim v0.8.0 My vscode-neovim plugin page states 'last modified: 08/11/2022, 08:07:47' (I could not figure out how to get the version number for the plugin)

  1. When I disable all plugins (except vscode-neovim) and set the init.lua config path to NONE then I do not experience the issue.
  2. When I enable all plugins (except vscode-neovim) and still have the config path to NONE I still do not experience this issue. (even with multiple linters installed, like Prettier, and markdownlint when editing markdown files)
  3. When I introduce my config init.lua without any extensions; I begin to experience the issue (albeit less frequently than when I have vscode linting plugins and init.lua enabled).
  4. after removing all autocmds and almost all keymaps (some of them with <c-...> do not like running inside vscode) the issue is pretty much gone.

So, I think it is most likely issues in the users init.lua. (Maybe this answer will help someone experiencing this issue as well.)

I also find that the vscode-neovim performs much worse in general when my config is loaded (even with most things removed) Narrowing down what options need to be excluded with if vim.g.vscode then ... is quite a process if you already had a beefy init.lua and I think I need to work through my config again with the setup guide in the README and try to use VSCodeCall/VSCodeNotify as recommended.

In case this is still considered a bug (doubt) Here is a file that I was testing with. It mostly happens when changing between modes and doing short inserts and quick movements around syntax elements like -, ##, 1. etc. and the issue is worse with larger files, and files with more syntax elements like code files.

# Lorem Ipsum

Velit quibusdam sint eos dolores ab iure. Dolorem nulla vitae et qui id. Voluptas unde rerum ipsam est doloribus eum ducimus. Nam fuga optio quo labore occaecati vel sint vel.

> Dolor quia vero voluptate ad illum dicta iste minus. Doloremque adipisci ut et porro illo suscipit. Omnis quod voluptatum dignissimos illum doloribus quasi reiciendis voluptatem. Et facilis iste quasi.

Ipsum aut sed tempora doloribus aut.
Nisi corporis nobis magnam quis molestias nemo.
Sed labore enim aperiam.
Repellat et enim earum cumque.

- Eos sint est corrupti consequatur blanditiis quasi est nam.
- Voluptate aut quas adipisci rerum.
- Aut cupiditate consequatur soluta dignissimos et laudantium.
- Velit aspernatur aut voluptates veritatis sunt quo.
- Eveniet reprehenderit vel cum quis.
- Earum ex distinctio veniam.

## Hic sit excepturi officiis

Quas dolor qui cupiditate adipisci odio culpa quod.
Numquam consequatur labore deserunt sed.

Illum dolorem omnis aut eos voluptas et sapiente.
Voluptas perferendis omnis consequatur facilis magnam quaerat corporis.
Fuga esse aliquid nostrum dolores dolorem culpa et vel.

\```text
Non asperiores placeat ipsam.
Nisi sapiente et minus a et.
Modi voluptates in ratione.
Ut sit tempore officiis doloribus distinctio id.
Dolorem numquam nobis atque.
\```

Non eaque ut et unde quibusdam iure totam.

1. Aut vero dignissimos laborum facilis aut quo corrupti.
1. Expedita quis in et aut explicabo temporibus aut et.
1. Corporis aliquid qui dolorem eos veritatis.
1. Et nemo dolores consequatur et excepturi expedita cupiditate fugit.

Dolores voluptatem reprehenderit necessitatibus dolorem sunt officia assumenda.
Voluptatibus non consequatur rem nostrum.
Voluptatem et nihil ut et dolore modi veritatis consequuntur.

Vel[^Vel] exercitationem dignissimos numquam pariatur magni quae et.
Unde ea autem vitae.
Nisi labore qui et dolores.
Quo necessitatibus quas voluptas sint sint et sit quasi.
Voluptatem ut est est neque quia eaque.

[^Vel] : Velit quibusdam sint eos dolores ab iure. Dolorem nulla vitae et qui id. Voluptas unde rerum ipsam est doloribus eum ducimus. Nam fuga optio quo labore occaecati vel sint vel.

plainoldcheese avatar Nov 10 '22 09:11 plainoldcheese

hi @windwp , here is a series of steps to reproduce, I am listing out the steps I did:

  1. Clone and setup the latest vscode neovim, I followed the instructions here.
  2. Open the repo in VSCode, go to debug view and click Run Extension (F5).
  3. Create a file with the following code:
import argparse
import logging


logging.basicConfig(level=logging.INFO)


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--yolo", type="str", required=True)
    args = parser.parse_args()

    logging.info("this is a dummy test program which pipes your message")
    logging.info(args.yolo)


if __name__ == "__main__":
    main()

  1. Replace the yolo in file with something using the command %s/yolo/something in vim command line.
  2. Undo the modification.
  3. You will see a garbage character like the one in the image below: image

abhiskk avatar Nov 10 '22 20:11 abhiskk

I still can't reproduce this issue. it will better if someone can send a file and a specify step to reproduce you can try this PR #1075 but i am not sure.

@windwp I can confirm that your fix in #1075 works for me.

abhiskk avatar Nov 10 '22 20:11 abhiskk

@abhiskk I cannot reproduce with your steps. Are you on latest version of nvim?

theol0403 avatar Nov 10 '22 20:11 theol0403

Yes, I am on the latest version of nvim on mac-osx

abhiskk avatar Nov 10 '22 22:11 abhiskk

I can reproduce it . #1075 will fix that.

windwp avatar Nov 11 '22 00:11 windwp

I'm still seeing this as an issue over time. I was able to trigger it once when using u but have not found a perfect reprod as of yet.

CRSBMW avatar Oct 12 '23 06:10 CRSBMW

@CRSBMW Need stable reproduction method and screen recording

xiyaowong avatar Oct 12 '23 06:10 xiyaowong

Yeah I've been trying to find one. I have a hunch its related to errorlens but a stable reproduction is very difficult. I will keep looking to see if I can find something thats at least not entirely random

CRSBMW avatar Oct 12 '23 08:10 CRSBMW

@CRSBMW If you have a reproduction method or a screenshot of the problem, please open a new issue

xiyaowong avatar Oct 12 '23 08:10 xiyaowong

@xiyaowong Seems quite reproducible with Rust Analyzer on. It's impossible to code rust in VSCode with NeoVim mode installed. It's specially bad when you start using o , O, cw and moving things around while in normal mode.

In the example below I create a new line (o) then delete it (dd).

recording

caiotoon avatar Dec 09 '23 05:12 caiotoon

@caiotoon Please open a new issue, I never encountered this while using rust-analyzer. Probably related to #1624 ?

xiyaowong avatar Dec 09 '23 06:12 xiyaowong

I have had this happen to me when I setup neovim with kickstart. I hadn't modified kickstart base init.lua. Removed kickstart and it started looking fine. Is there anyway to get it working without having to remove kickstart?

ayappaP avatar Jan 02 '24 06:01 ayappaP

@ayappaP No! Please do not use any community config when using vscode-neovim. These configs contain too many plugins and options. In fact, in vscode-neovim, you don't need any config, usually you just need mappings.

xiyaowong avatar Jan 02 '24 09:01 xiyaowong