Hi,

On Thu, Aug 18, 2016 at 5:48 AM, Michael Henry <v...@drmikehenry.com> wrote:
> On 08/17/2016 01:58 PM, Yegappan Lakshmanan wrote:
>> On Wed, Aug 17, 2016 at 4:12 AM, Michael Henry <v...@drmikehenry.com>
> wrote:
>>> I'd like functions that:
>>>
>>> - Return True if a given window is a QuickFix or Location List
>>>   window.
>>> [...]
>>
>> The new getwininfo() function can be used to distinguish between
>> the quickfix and location list windows. Check the 'quickfix' and the
>> 'loclist' keys in the returned dictionary.
>> [...]
>>
>> The getqflist() function returns the window ID of the quickfix window
>> (if it is opened). You can check for this.
>> [...]
>> You can use the getqflist() and getloclist() functions for these.
>>
>> - Yegappan
>
> Thanks, Yegappan, that's very helpful.  I think these extensions
> will make things much smoother.
>
> I was trying to find something in the help regarding the meaning
> of a "window id".  Though there are several functions that
> accept and return these, I can't find anything that defines
> them.
>

The window identifier is described in windows.txt. I am copying
the description below:

Each window has a unique identifier called the window ID.  This identifier
will not change within a Vim session. The |win_getid()| and |win_id2tabwin()|
functions can be used to convert between the window/tab number and the
identifier.  There is also the window number, which may change whenever
windows are opened or closed, see |winnr()|.

>
> Perhaps the help could contain a definition of window ID that
> answers these questions:
>
> - How does a window ID differ from a window number?
>

As described above, the ID of a window is unique in a Vim session.
OTOH, the window number can change as new windows are
created and existing windows are closed.

>
> - Since getloclist() accepts either a window number or a window
>   ID for the first argument, these two number spaces must be
>   non-overlapping; how does Vim ensure this property?
>

The window identifiers are internally assigned values greater
than 1000 (assuming that the number of windows will be less
than 1000).

>
> - Are window IDs unique across tab pages?
>

Yes. The window IDs are unique across all the tab pages.

>
> - Are window IDs more permanent in some way than window numbers?
>   For example, if I rearrange the windows in a tab page, do the
>   window numbers change but the window IDs remain the same?
>

Yes. The window numbers will change as you add/remove windows.

>
>   That empirically seems to be the case when I move the QuickFix
>   window around within a tab page; is this guaranteed?  The
>   window id empirically changes when closing and reopening the
>   QuickFix window and when moving the QuickFix window to another
>   tab; does that mean that the window ID stays the same until
>   the window is closed?
>

Yes. Each newly opened window is assigned a unique identifier.

>
> Also, in the help for getwininfo() (vim 7.4.2222) is this
> sentence:
>
>   """
>   Without an information about all the windows in all the tab
>   pages is returned.
>   """
>
> Should that start with "Without {winid}, information about..."?
>

Yes. The help text needs to be corrected.

- Yegappan

>
> Thanks,
> Michael Henry
>

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui