Hi,

On Wed, Mar 20, 2019 at 9:39 AM Daniel Hahler <[email protected]> wrote:
>
> The following patch achieved my expected behavior:
>
> diff --git c/src/quickfix.c i/src/quickfix.c
> index d332e2364..8344398bd 100644
> --- c/src/quickfix.c
> +++ i/src/quickfix.c
> @@ -2924,6 +2924,11 @@ qf_goto_win_with_qfl_file(int qf_fnum)
>
>      win = curwin;
>      altwin = NULL;
> +    if (IS_QF_WINDOW(win)) {
> +       if (prevwin && !prevwin->w_p_pvw && bt_normal(prevwin->w_buffer)) {
> +           altwin = prevwin;
> +       }
>

Can you move the above code into the below for() loop where there is a check for
IS_QF_WINDOW()? Can you also add a comment about this?

>
> +    }
>      for (;;)
>      {
>         if (win->w_buffer->b_fnum == qf_fnum)
>
> TEST CASE: vim -Nu NONE -c 'vsp' -c 'grep! vim README.md' -c 'copen' -c 'exe 
> "norm \<CR>"'
>

Can you convert this into a test in test_quickfix.vim?

Thanks,
Yegappan

>
> Without this patch the file is displayed in window 2, while with this patch 
> it is window 1 (where :copen was done from, and where ctrl-w ctrl-p would go 
> to).
>
> (it confused me previously that there is a comment "go to previous window" in 
> that function, but it uses ->w_prev, which is not the same/similar to prevwin)
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui