On 12:20 Sun 27 Apr     , Bram Moolenaar wrote:
> 
> Marcin Szamotulski wrote:
> 
> > > > > > I'm sure someone will ask for another thing: What local argument
> > > > > > list is being used.  They can be shared between windows.
> > > > > > 
> > > > > > A more generic solution would be to request the ID of the local
> > > > > > argument list.  When zero, then the window is using the global
> > > > > > argument list.
> > > > > > 
> > > > > > And then we of course also want to optionally pass in the window
> > > > > > number.  So it would be:
> > > > > > 
> > > > > >     arglistid([winnr])
> > > > > 
> > > > > Yes that's much better solution.  I have a question though.  The
> > > > > alist_T structure does not contain an ID of arglist (only list of
> > > > > files, and number of windows using it).  How should I generate the
> > > > > ID?
> > > > 
> > > > You could use the pointer and turn it into an int, but that's ugly (and
> > > > doesn't work if sizeof(int) is smaller than sizeof(char *).
> > > > 
> > > > So the best is to add an ID to alist_T and use a static global to store
> > > > the last used ID.  That's in alist_new().
> > > 
> > > Thanks.  I'll follow your advice.
> > 
> > I attach the patch for arglistid().
> 
> Thanks, I'll add it in the todo list.

Thanks,

Marcin Szamotulski

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui