-
-
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
job: close quickfix window if a job has succeeded #1123
Conversation
@@ -57,16 +57,17 @@ function go#job#Spawn(args) | |||
endif | |||
endif | |||
|
|||
let l:listtype = "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 think we should use here: let l:listtype = go#list#Type("quickfix")
. the Type()
function returns the user preference (can be set via go_list_type
) , if there is none, then the argument itself is returned.
Btw, the current code is all set to |
Yes, I am experiencing the very same problem as described in #1109. And it does indeed fix it for me. Initially, I though that go#list#Window(0) would close 'localtionlist', but now I see that it should close 'quickfix' by default. So I'm not sure how this patch fixes it, anymore :) I'm going to dig a bit deeper here. |
Ok, so I added some debug messages to list.vim:
And here is the output of successful build (e.g. the one that should close currently open quickfix window):
For some reasons, even though l:listtype == 0, this condition ' if l:listtype == "locationlist"' is true. |
Ok, looks like I understand what's going on here. vim casts "locationlist" to an int, since this is the type of the first comparison argument, and it becomes zero. That why the condition is true. |
@fatih Ok, so I've updated the patch to use go#list#Type and also fixed the same problem (integer arguments to go#list#Window()) in jobcontrol.vim. I don't have neovim installed, so jobcontrol.vim change is untested. |
@@ -99,9 +99,10 @@ function! s:on_exit(job_id, exit_status) abort | |||
|
|||
call s:callback_handlers_on_exit(s:jobs[a:job_id], a:exit_status, std_combined) | |||
|
|||
let l:listtype = go#list#Type("locationlist") |
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.
Can you change this to quickfix
as well? I know it was already like this before, but let us be consistent with the others as well. It also fixes #1019 as well :)
@pborzenkov this looks good. Just a minor comment, once that is in, it's ready to be merged. |
Otherwise all previous build errors are shown even after successful build. Fixes #1019, #1109 Signed-off-by: Pavel Borzenkov <[email protected]>
@fatih Done. |
Thanks @pborzenkov 👍 |
Otherwise all previous build errors are shown even after successful
build.
Signed-off-by: Pavel Borzenkov [email protected]