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

quickfix list clobbered on save #1389

Closed
nyarly opened this issue Jul 26, 2017 · 7 comments · Fixed by #1407
Closed

quickfix list clobbered on save #1389

nyarly opened this issue Jul 26, 2017 · 7 comments · Fixed by #1407

Comments

@nyarly
Copy link

nyarly commented Jul 26, 2017

Behavior

Having just updated vim-go, I've noticed that when I save codefiles, my quickfix window closes and the quickfix list is emptied. When correcting e.g. compile errors, this is irritating because

Steps to reproduce:

Please create a reproducible case of your problem. If this step is
not provided, the issue will be closed

Re produce it with a minimal vimrc with all plugins disabled and
only vim-go enabled:

  1. open a Go project
  2. :make
  3. :cw
  4. < quickfix window opens with errors >
  5. :update
    6 < quickfix window closes, :cw won't reopen >

Configuration

Add here your current configuration and additional information that might be
useful, such as:

This is vim-go 76cd99d, under Neovim 0.1.7, and Go 1.7.4.

@ef2k
Copy link

ef2k commented Jul 29, 2017

I had the same issue and had to roll back to go-vim v1.12 (26362e4). Now the quickfix window is being displayed with build errors again.

@josephholsten
Copy link

Looks like this was introduced by e4e992a

Fortunately, it documents a workaround:

    let g:go_list_type = "locationlist"

@josephholsten
Copy link

I think https://stackoverflow.com/questions/20933836/what-is-the-difference-between-location-list-and-quickfix-list-in-vim sums up why locationlist is more appropriate anyway. TL;DR:

More generally: The quickfix list is best when your search or compile involves multiple files, the location list best when only a single file is involved. – Trebor Rude Aug 29 '14 at 17:40

@josephholsten
Copy link

@fatih can we revert e4e992a in light of the above?

@fatih
Copy link
Owner

fatih commented Aug 8, 2017

Not sure how to fix it. Quickfix is global. So is Locationlist as well. What if you use locationlist for both save and format as well? In that case this will still happen.

This can be fixed by disabling the following line in ftm.vim

  " this closes the window if there are no errors or it opens
  " it if there is any
  call go#list#Window(l:listtype, len(a:errors))

luckily we have a new setting that prevents autoclosing it. So if you add the following you should be good to go:

let g:go_list_autoclose = 0

But I need to look more detaily for this. Let me know what happens if you add this setting and how it works for you (didn't tested it)

@hori-ryota
Copy link
Contributor

How about g:go_list_type_for_autosave ?

I need to keep quickfix when execute command like GoErrCheck and GoMetalinter. But now, list is Overwritten and deleted by autosaving.

So, I want to use quickfix when execute command and use locationlist when autosave.

@fatih
Copy link
Owner

fatih commented Aug 13, 2017

This is fixed now (please pull master) and now it won't close it anymore, unless it's the list created by :GoFmt itself (or autosave). Thanks for the feedback again.

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.

5 participants