vim-go icon indicating copy to clipboard operation
vim-go copied to clipboard

source window becomes blank with cgo compile warnings

Open aletheia7 opened this issue 7 years ago • 1 comments

What did you do? (required. The issue will be closed when not provided.)

I was editing a go file and issued :GoInstall The problem is repeatable. It seems that cgo compiler warnings can mess with the vim/vim-go errors interactions. The problem only occurs with one app.

I use vim-go all day long. Thank you for making vim-go.

What did you expect to happen?

The go source would remain present as usual and go syntax errors would show-up in the vim errors window.

What happened instead?

The go source code disappeared (window was still present) and the errors windows was populated with three lines.

I think the problem is triggered by the following go install -v output:

$ go install -v
# <redacted>/vendor/github.com/google/gousb
cgo-gcc-prolog: In function ‘_cgo_8c50a4ca37d7_Cfunc_libusb_set_debug’:
cgo-gcc-prolog:505:2: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
In file included from vendor/github.com/google/gousb/libusb.go:31:0:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
 void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
                  ^~~~~~~~~~~~~~~~

Configuration (MUST fill this out):

  • vim-go version:

    afbfc3765335626b21be2d656f22aecfcb125781 (latest)

  • vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):

I can comment-out all plugins except vim-go and the problem still occurs.

filetype off                  " required                                                                                                                                                                             
                                                                                                                                                                                                                     
" set the runtime path to include Vundle and initialize                                                                                                                                                              
set rtp+=~/.vim/bundle/Vundle.vim                                                                                                                                                                                    
call vundle#begin()                                                                                                                                                                                                  
" alternatively, pass a path where Vundle should install plugins                                                                                                                                                     
"call vundle#begin('~/some/path/here')                                                                                                                                                                               
                                                                                                                                                                                                                     
" let Vundle manage Vundle, required                                                                                                                                                                                 
Plugin 'VundleVim/Vundle.vim'                                                                                                                                                                                        
Plugin 'fatih/vim-go'                                                                                                                                                                                                
Plugin 'fatih/molokai'                                                                                                                                                                                               
Plugin 'tcomment'                                                                                                                                                                                                   
Plugin 'othree/html5.vim'                                                                                                                                                                                           
Plugin 'Valloric/YouCompleteMe'                                                                                                                                                                                     
Plugin 'Valloric/ListToggle'                                                                                                                                                                                        
Plugin 'eapache/rainbow_parentheses.vim'                                                                                                                                                                            
Plugin 'godlygeek/tabular'                                                                                                                                                                                          
Plugin 'plasticboy/vim-markdown'                                                                                                                                                                                    
" All of your Plugins must be added before the following line                                                                                                                                                        
call vundle#end()            " required                                                                                                                                                                              
filetype plugin indent on    " required                                                                                                                                                                              
                                                                                                                                                                                                                     
let g:go_fmt_experimental=1                                                                                                                                                                                          
                                                                                                                                                                                                                     
set shell=/bin/bash\ -l                                                                                                                                                                                              
set nocompatible                                                                                                                                                                                                     
set t_Co=256                                                                                                                                                                                                         
set nu ic sw=4 ts=4 smartindent tf                                                                                                                                                                                   
set matchtime=0                                                                                                                                                                                                      
                                                                                                                                                                                                                     
"let loaded_matchparen = 1                                                                                                                                                                                           
                                                                                                                                                                                                                     
let g:rehash256 = 1                                                                                                                                                                                                  
let g:molokai_original = 1                                                                                                                                                                                           
au colorscheme molokai hi LineNr term=standout ctermfg=81 gui=bold guifg=#66D9EF|hi SpecialKey term=standout ctermfg=81 gui=bold guifg=#66D9EF|hi NonText term=standout ctermfg=81 gui=bold guifg=#66D9EF|hi Comment term=underline ctermfg=208 guifg=#FD971F|hi Visual term=reverse cterm=reverse ctermfg=193 ctermbg=16 gui=reverse guifg=#C4BE89 guibg=#000000                                                                         
colo molokai                                                                                                                                                                                                         
"let g:go_def_mode = 'godef'                                                                                                                                                                                         
                                                                                                                                                                                                                     
set modeline                                                                                                                                                                                                         
set fdm=syntax                                                                                                                                                                                                       
set nofen                                                                                                                                                                                                            
set noshelltemp                                                                                                                                                                                                      
syntax on                                                                                                                                                                                                            
set foldmethod=syntax                                                                                                                                                                                                
let g:fastfold_togglehook = 1                                                                                                                                                                                        
let g:go_asmfmt_autosave = 1                                                                                                                                                                                         
set completeopt-=preview                                                                                                                                                                                             
"highlight ColorColumn ctermbg=Gray                                                                                                                                                                                  
highlight ColorColumn ctermbg=darkgray                                                                                                                                                                               
set pastetoggle=<F2>                                                                                                                                                                                                 
                                                                                                                                                                                                                     
let g:go_metalinter_enabled = ['vet', 'golint']                                                                                                                                                                      
let g:go_gocode_unimported_packages = 1
  • Vim version (first three lines from :version):

    VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 27 2018 02:08:08)
    Included patches: 1-1766
    Modified by [email protected]

  • Go version (go version):

go version go1.10.1 linux/386

  • Go environment (go env):

GOARCH="386" GOBIN="" GOCACHE="/home/erik/.cache/go-build" GOEXE="" GOHOSTARCH="386" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/erik/go" GORACE="" GOROOT="/usr/lib/go-1.10" GOTMPDIR="" GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_386" GCCGO="gccgo" GO386="387" CC="gcc" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-s -w" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build811200738=/tmp/go-build -gno-record-gcc-switches"

aletheia7 avatar May 18 '18 06:05 aletheia7

If preform a vim :rew after the source disappears, the source reappears.

aletheia7 avatar May 18 '18 06:05 aletheia7