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

FileChangedShell autocmd blocks reload/prompt on file changes #2548

Closed
jcordasc opened this issue Oct 23, 2019 · 0 comments · Fixed by #2549
Closed

FileChangedShell autocmd blocks reload/prompt on file changes #2548

jcordasc opened this issue Oct 23, 2019 · 0 comments · Fixed by #2549

Comments

@jcordasc
Copy link

jcordasc commented Oct 23, 2019

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

  1. Open a go source file in vim w/ vim-go plugin loaded.
  2. Update the file outside of vim.
  3. Return to vim.

What did you expect to happen?

Expect either:

  • you get prompted that the file has changed
  • the file reloads if you have autoread set

What happened instead?

Nothing. No prompt or reload is triggered.

Configuration (MUST fill this out):

vim-go version: v1.20+

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

vimrc
" no config needed

Vim version (first three lines from :version):

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 26 2019 04:36:15)
macOS version
Included patches: 1-1600

Go version (go version):

go version go1.12.10 darwin/amd64

Go environment

go env Output:
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/user/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/user/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.10/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.10/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/21/8dfdmhv92pggrb64ccm2_y040000gp/T/go-build594152047=/tmp/go-build -gno-record-gcc-switches -fno-common"

Cause

Per the FileChangedShell and timestamp documentation, this is expected behavior when a FileChangedShell autocommand is registered that doesn't handle this itself, nor does it set v:fcs_choice.

Such an autocommand was introduced in this commit.

I'm also submitting a PR to change the autocommand to a FileChangedShellPost which will allow for vim's regular behavior on file changes and still call go#lsp#DidChange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant