-
-
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
support configurable list types #700
Conversation
Thanks @bhcleek for the PR. I'm aware of this just hadn't the time to look at in more detail. This is a needed PR as it's really annoying to me too lately. So I want to use this to test how it works with quickfix + neovim. I'll let you know and also add comments. |
Thank you for the update @fatih. I'm really looking forward to getting this merged; I've been using it since I submitted it and am pleased with the lists. |
@bhcleek could you rebase it again on top of master? Sorry for the inconvenience but seems like it's not mergable anymore due recent changes. |
* Prefer the quickfix window for commands whose output is considered to be errors for more than current buffer. e.g. :GoBuild. * Prefer the location list window for commands whose output is related specifically to the current buffer only (e.g: :GoFmt and :GoImplements). * Rename 'g:go_loclist_height' to 'g:go_list_height'. * Add a new option, 'g:go_list_type', to configure whether to always use the quickfix window, a location list window, or to vary based on the preferred window as documented above.
@fatih I've rebased on top of master. |
Can you rename all |
endfunction | ||
|
||
function! go#list#Type(quickfix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need this. It's yet another abstraction and seems like we don't need it. Can you remove it? Anywhere else just let use strings. Like:
if a:listype == "quickfix"
endif
This is more readable and we don't need to manually parse what 0
or 1
means.
@bhcleek so as a final note, remove the |
There are two different times that resolution of the preferred window and |
* Refactor to use strings for list types instead of an integer. * rename variables that store the list type.
@fatih I refactored to pass strings instead of integers. I'll wait to make the change to remove |
@bhcleek sorry but I still didn't grasp the importance of let l:listtype = go#list#Type(a:listtype)
if l:listtype == "locationlist"
return getloclist(0)
else
return getqflist()
endif But you can also write this as: if a:listtype == "locationlist"
return getloclist(0)
else
return getqflist()
endif So what's the difference ? |
Maybe this will help: https://github.com/bhcleek/vim-go/blob/master/doc/vim-go.txt#L1010 |
Thanks @bhcleek, now it makes sense 👍 There is nothing that keeps me to merge this, I've already pulled and working with. Let me use this way 1,2 day and I'll merge it (so I can catch any errors meanwhile as I'm heavily using vim-go while developing our projects in my full time job). Thanks again 👍 |
Thanks @bhcleek a lot for your contribution. This is very useful and most needed feature we needed. If you see any errors or any improvements please feel free to open an issue or send a PR to discuss further. |
I'm happy to help @fatih. If I find any problems, I'll submit a PR to get them fixed. FWIW, I've been using this for two weeks successfully. 👍 |
Really like this one 👍 Thx! |
be errors for more than current buffer. e.g. :GoBuild.
specifically to the current buffer only (e.g: :GoFmt and
:GoImplements).
the quickfix window, a location list window, or to vary based on the
preferred window as documented above.
@fatih I'm not sure if you'd want to keep the default as I've coded it. The default here is to vary the list by the command, but that changes the 1.4 behavior, and we'd talked about preserving the 1.4 behavior by default.
I tried to update the relevant documentation where the location list was referenced to be accurate according to the preferred windows that I described above, but please double check my work.
Consider this a start point - I realize you may have lots of feedback; I'm happy to do any rework that you find necessary.
Fixes #696