With vim-go when doing save and the source code have errors which are added to 'llist' vim spitting errors Connot make changes, 'modifiable' is off.

Hi @osleg. Please provide a test case. A simple demo.go file with errors, and then the exact commands you input to Vim to reproduce it. Also please provide your Vim version and also which Version of vim-go you're using. Thanks
@osleg are you trying to modify the location list? You cannot do that.
@nhooyr I know :)
@fatih
That's usually happens when there is syntactic error like missing brackets like this:
package main
func main() {
a := "asd"
if a == "asd" {
b := a
}
With this case it spitting when i'm writing the buffer :w<Enter>:
"main.go" 8L, 71C written
0
Gofmt returned error
Error detected while processing function StripTrailingWhitespace:
line 6:
E21: Cannot make changes, 'modifiable' is off
Gofmt returned error
E21: Cannot make changes, 'modifiable' is off
Gofmt returned error
"main.go" 8L, 70C written
Press ENTER or type command to continue
Though after hitting "Enter" the loc list is filled anyway, but this is quite annoying :)
I don't know what StripTrailingWhitespace is doing as it's not a function inside vim-go. I don't think this is vim-go related, one of your plugins is misbehaving. I'm closing this. Thanks
Hi @osleg, I had the same problem while using the editorconfig/editorconfig-vim plugin with the trim_trailing_whitespace option enabled.
This fixed it for me then:
[*.go]
indent_style = tab
insert_final_newline = false
trim_trailing_whitespace = false
Hope it helps,
Marcus
FYI, this is related to, at least, spf-13, a workaround is available here : https://github.com/spf13/spf13-vim/issues/957#issuecomment-306510976
It seems that both vim-go and trim white list function are trying tobwrite into file while one of them (vim-go I suspect) setting modifiable to no while working.
Looks like a race condition here
Most helpful comment
Hi @osleg, I had the same problem while using the editorconfig/editorconfig-vim plugin with the
trim_trailing_whitespaceoption enabled.This fixed it for me then:
Hope it helps,
Marcus