Thanks. That is one of a way to do it.
another way I notice it to parse the `ls` result. I have something like this in my environment (MacVim).
> 16 a- "[Location List]" line 0
> 17 %a- "[Quickfix List]" line 1
Do you get the same results?
Thanks.
On May 15, 2013, at 11:18 AM, Ben Fritz <fritzophrenic@gmail.com> wrote:
> On Tuesday, May 14, 2013 2:45:16 PM UTC-5, Christian Brabandt wrote:
>>
>> Anyway, I am not aware of any option you can check to differentiate
>>
>> between quickfix and location lists. You could try to check the
>>
>> w:quickfix_title variable, it could give a clue.
>>
>
> I did this differently. In an ftplugin file for "qf" type, I actually store off the current window number, call ":copen", and check to see whether the current window number is still the same. Note you need to have a guard variable to prevent recursion.
>
> if &buftype=='quickfix'
> if !exists('s:processing')
> let listbufnr = bufnr("%")
> let numwindows = winnr('$')
> let curwin = winnr()
> let s:processing = 1
> copen
> call setbufvar(listbufnr, 'errorlist_type', (curwin == winnr() ? quickfix' : 'location'))
> " close the quickfix list if it was closed when we began
> if numwindows != winnr('$')
> cclose
> endif
> " return to quickfix/location list
> exe curwin 'wincmd w'
> unlet s:processing
> endif
> endif
>
> Now b:errorlist_type holds the type of quickfix list.
>
> --
> --
> You received this message from the "vim_use" 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_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment