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

Location list #626

Merged
merged 6 commits into from
Nov 26, 2015
Merged

Location list #626

merged 6 commits into from
Nov 26, 2015

Conversation

fatih
Copy link
Owner

@fatih fatih commented Nov 26, 2015

Add support for location list instead of using quickfix window. This allows us to let each window having it's own list of errors displaying. Below is an example of it:

image 2015-11-26 at 7 04 03 pm

Because of consistency, the previous setting: go_quickfix_height is renamed to go_loclist_height. (the single breaking change we have)

This is a feature I really like. I also refactored all error parsing, populating, displaying, etc.. functions into a single file to make maintaining much more easier in the future.

@fatih
Copy link
Owner Author

fatih commented Nov 26, 2015

Merging this as this is also going to be used by #607.

fatih added a commit that referenced this pull request Nov 26, 2015
@fatih fatih merged commit 0daf802 into master Nov 26, 2015
@fatih fatih deleted the location-list branch November 26, 2015 21:30
@sasha-s
Copy link

sasha-s commented Dec 8, 2015

This made vim-go pretty much unusable for me on a laptop (limited horizontal space) with vertical splits.
I am used to having a single wide quickfix window (so I can see the multiple errors without wrapping.
I was also able to navigate to next/prev error (either in same file or not), which was handy.
Is there a way of doing it with location lists?

@fatih
Copy link
Owner Author

fatih commented Dec 8, 2015

You can change the location of the window. It's up to you, it's not vim-go's fault. Please check out Google or have a look at my dotfiles where I'm modifying it (github.com/fatih/dotfiles). So put this:

" This trigger takes advantage of the fact that the quickfix window can be
" easily distinguished by its file-type, qf. The wincmd J command is
" equivalent to the Ctrl+W, Shift+J shortcut telling Vim to move a window to
" the very bottom (see :help :wincmd and :help ^WJ).
 autocmd FileType qf wincmd J

So for your case put this into your vimrc:

 autocmd FileType qf wincmd L

@svanharmelen
Copy link
Contributor

I must admit I feel the same way about the move from one quickfix window to multiple (one per buffer) location lists.

Being able to automatically move the lists based on the filetype is nice, but in the case of a location list per buffer, you can very easily end up with a few location lists stacked on top of each other. And if you want to close them with :lclose it means you have to find the buffer it was related to. I had this several times the last week and found it pretty annoying.

All of this was way nicer with the one single quickfix window (which I also automatically moved by the way), so if it could be made configurable (to use either a single quickfix or multiple location lists) that would be really awesome!

Cheers!

@fatih
Copy link
Owner Author

fatih commented Dec 14, 2015

This PR not only introduced the change to location list, but it also changed how we call an error window. It's pretty easy to change it back to quickfix. But the problem is that quickfix is racy with Neovim integration and not something that fits into the model of NeoVim. For example you can easily execute :GoBuild in two windows and edit on a separate third window. Location list makes it more useful here as each window has it's own list.

@svanharmelen
Copy link
Contributor

I must admit that after working with it for a while, I seem to have found my way with it... Still think it's not as clean as using the quickfix window, but I can work with it and I do see the additional benefits you discussed. So I'm good 😉 Thx...

@ebfe
Copy link
Contributor

ebfe commented Dec 15, 2015

It's pretty easy to change it back to quickfix.

Any pointers on how to do that?

@fatih
Copy link
Owner Author

fatih commented Dec 15, 2015

@ebfe It's in autoload/go/list.vim. All locallist references needs to be changed to quickfix and that's it.

@ebfe
Copy link
Contributor

ebfe commented Dec 15, 2015

@faith Thanks.

Would it be acceptable to have this as an option? While the new behaviour might
be superior, it is somewhat annoying when you are also working with other
languages and have to switch how you navigate build/test errors all the time.

@fatih
Copy link
Owner Author

fatih commented Dec 15, 2015

In the future maybe @ebfe You can open a separate PR so we don't forget it. But I'm not sure If want to implement based on prior comments.

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 this pull request may close these issues.

None yet

4 participants