rust-lang / rust.vim

Vim configuration for Rust.
Apache License 2.0
3.91k stars 297 forks source link

Unwanted characters are displayed when using a rust.vim plugin. #273

Open lukgreen opened 6 years ago

lukgreen commented 6 years ago

rust.vim version: adc4db764c0a55515dc34d047fed64a74750c57a vim version: 8.0.1453

After opening a Rust file there is an uneditable chain of characters after the end of the first line. Sometimes it appears in some other line. After some (not instantly) editing these characters disappear:

image No wonder they annoy me greatly.

da-x commented 6 years ago

On which terminal program and OS you see this problem?

lukgreen commented 6 years ago

Ubuntu 18.04.1, GNOME Terminal 3.28.2

da-x commented 6 years ago

Those strings of characters look like codes for RGB colors (though, 16-bit for each color, which is odd). Can't think of any way rust.vim to directly cause it. Maybe you have some other Vim plugin installed that prints them to stdout?

avandesa commented 6 years ago

I have the same issue. Junk is often printed when first opening vim as well. Vim seems to be interpreting it as a command? However, disabling either Syntastic or rust.vim makes both the issues go away. Perhaps there's a conflict between the two plugins?

Using the latest master of both plugins with pathogen.

chris-morgan commented 6 years ago

This will either be a Vim terminal configuration bug (some t_* variables set improperly), or a terminal bug. Plugins may be triggering it, but theirs is not the responsibility.

kazarin commented 5 years ago

OS: macOS Mojave 10.14 Terminal: iTerm2 3.27 rust.vim: de998a syntastic: 11aa21ede vim: 8.1

Got the same behavior

Screenshot 2019-07-18 at 15 28 03
SolidTux commented 4 years ago

I get a very similar thing when running :RustFmt on nvim. Happens for nvim, nvim-gtk and gnvim (haven't check others). Configuration

call plug#begin('~/.local/share/nvim/plugged')
Plug 'rust-lang/rust.vim'
call plug#end()

Result after rustfmt

Bildschirmfoto vom 2020-05-16 22-11-32

EDIT: Ok, I found the solution to my problem. I used fish and called the initialization function for the gruvbox theme on startup. Changing this to it only being called for an interactive shell solved the problem.

RoboticRaven commented 3 years ago

Same issue for me:

Can confirm that switching off syntastic/rust.vim will solve the weird behaviour ...sadly I wouldn't know how to apply the fix that worked for solidTux.

Edit: The gibberish string is visible before vim renders the content of the file and only appears when opening a *.rs file

paolobettelini commented 1 year ago

I would also like to point out how I fixed this behavior. When I ran fmt on a file, the stdout of my shell (fish) when I open it would be added to the top of the file. This is because I was printing all of those contents regardless of whether the shell was interactive or not. config.fish:

if status --is-interactive
    # print your stuff here
    neofetch # or whatever
end
# not here