When trying to save a *.go file, vim-go throws a big error:
Error detected while processing function <SNR>41_fmt_autosave[3]..go#fmt#Format[45]..go#fmt#update_file[30]..go#list#Type:
line 1:
E121: Undefined variable: s:default_list_type_commands
E116: Invalid arguments for function get(s:default_list_type_commands, a:for))
E116: Invalid arguments for function s:listtype(get(s:default_list_type_commands, a:for))
Add here your current configuration and additional information that might be
useful, such as:
vimrc you used to reproduce
vim version:
NVIM v0.2.0
Build type: Release
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/config -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/src/nvim/auto -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/include
Compiled by [email protected]
Optional features included (+) or not (-): +acl +iconv +jemalloc +tui
For differences from Vim, see :help vim-differences
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/0.2.0_1/share/nvim"
vim-go version:
5730b71ea57c3db0972968889a1d098139cb6031
go version:
go version go1.9 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/markbates/Dropbox/development/gocode"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zj/ktv0trrj4l79dfq0dkm1b6d40000gn/T/go-build150993606=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
The problem appears to be introduced with this merge: https://github.com/fatih/vim-go/commit/5730b71ea57c3db0972968889a1d098139cb6031 after reverting that the errors stop.
Seeing that error too with my config.
E121: Undefined variable: s:default_list_type_commands
E116: Invalid arguments for function get(s:default_list_type_commands, a:for))
E116: Invalid arguments for function s:listtype(get(s:default_list_type_commands, a:for))
E15: Invalid expression: s:listtype(get(s:default_list_type_commands, a:for))
I am also able to stop the errors by reverting to commit b319ed9753906a0737bfbd5d5e69b443966a8cd8
vim-version:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 4 2017 11:35:46)
MacOS X (unix) version
Included patches: 1-1050
Compiled by Homebrew
go version
go version go1.9 darwin/amd64
@hackebrot if you roll back that commit I mentioned the error goes away. it's a good temporary fix.
Thanks for reporting! #1453 should fix it; I don't have time to test it extensively at the moment, need to do some other stuff now. Would appreciate if you could test.
Most helpful comment
@hackebrot if you roll back that commit I mentioned the error goes away. it's a good temporary fix.