-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
GoFmt formats the file but also (and undesirably) saves the file #2635
Comments
Feel free to fork vim-go, push your branch to the fork, and create the PR in this repo. |
I should add, though, that there are several edge cases in the formatting code that need to be handled correctly. A PR that that changes the formatting code will need to cover all the currently covered use cases and not introduce any new bugs to be accepted. It's also advisable to make sure you're using the latest master as a branch point instead of v1.19 to avoid the potential of conflicts since fmt.vim has changed since v1.19. Having said that, though, a PR is a good way to start the conversation if you already have the code done. |
The solution to #2483 will likely also address this FWIW. There's details on that issue that will be relevant to any attempted alternative to the current method of formatting. |
#2729 allows formatting with |
(FYI I wrote a working fix for this issue branched off master, but I get a 403 when trying to push the branch to this repository.)
What did you do? (required: The issue will be closed when not provided)
I edited a .go file and I ran the GoFmt command.
What did you expect to happen?
I expected the code file to be formatted and for the file's changes to not be saved.
What happened instead?
The code file was formatted but also the file's changes were saved.
Configuration (MUST fill this out):
vim-go version:
v.1.19
vimrc
you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):I won't link to my >2,000 lines of vimrc spread across multiple files, by request. :) Nothing in all of it occurs to me as relevant to the present issue. Happy to provide any specific detail on request.
Vim version (first three lines from
:version
):VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec 9 2019 11:02:16)
Included patches: 1-127
Compiled by pizza@middlepart
Huge version without GUI. Features included (+) or not (-):
Go version (
go version
):go version go1.10.3 linux/amd64
Go environment
GOARCH="amd64"
GOBIN="/home/pizza/work/bin"
GOCACHE="/home/pizza/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pizza/work"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build165265883=/tmp/go-build -gno-record-gcc-switches"
The text was updated successfully, but these errors were encountered: