RE: Checking if a variable exists in a given tab

2006-08-09 Thread Max Dyckhoff
Hari,

That au sounds like a good solution, although it is still mildly
annoying that one can't get a tab variable from a specified tab! :)

Cheers,

Max

 -Original Message-
 From: Hari Krishna Dara [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 04, 2006 11:06 PM
 To: Max Dyckhoff
 Cc: A.J.Mechelynck; vim@vim.org
 Subject: RE: Checking if a variable exists in a given tab
 
 
 On Thu, 3 Aug 2006 at 10:39am, Max Dyckhoff wrote:
 
  If by making the desired tab current you mean using :tabn {count}
then
  it isn't allowed. I imagine changing tabs within the tabline
function
  would be A Bad Thing, and would cause recursion.
 
  I hadn't thought about using a global array of names, although it
would
  be a pain to maintain when one closes a tab (and I have better
things to
  program than that right now! :)
 
  Anyone else know if you can get a tab local variable somehow?
 
  Max
 
 The reason gettabwinvar() doesn't work is that the function returns
 window variable not tab variable. The difference between getwinvar()
and
 this is that the former refers to the current tab, where as you can
 specify a different tab using the later.
 
 There is no direct way of accessing this variable, I think this is
 lacking, as I was looking for a way to associate buffers to the tabs
in
 which they are opened (for my selectbuf plugin to have a way to show
 only the buffers edited in the current tab). I was thinking of a
 workaround in which buffers will have a local variable whose value is
 copied from the curret tab. You can probably do something similar
using
 a WinEnter autocommand, something like:
 
 au * WinEnter :let w:maxd_TabName = t:maxd_TabName
 
 This allows you to use gettabwinvar() function with 1 for winnr.
 
 --
 HTH,
 Hari
 
 
 
   -Original Message-
   From: A.J.Mechelynck [mailto:[EMAIL PROTECTED]
   Sent: Thursday, August 03, 2006 10:32 AM
   To: Max Dyckhoff
   Cc: vim@vim.org
   Subject: Re: Checking if a variable exists in a given tab
  
   Max Dyckhoff wrote:
I'm sure this is an easy one, I just can't find the answer
anywhere.
   
I'm writing my own tabline function (based heavily on the one by
  Tony
Mechelynck, thanks!) and I want to be able to name a tab
manually.
  The
best way I can think to do this is to have a tab local variable,
  such as
t:maxd_TabName. Only problem is that within the script I can
only
  check
if that variable exists within the CURRENT tab.
   
So how can I get a tab local variable from a numbered tab? I've
  found
gettabwinvar(), but I just can't make it work (echo
gettabwinvar(i,
  0,
maxd_TabName) doesn't work).
   
Thanks in advance!
   
--
Max Dyckhoff
AI Engineer
Bungie Studios
   
   
   
   
  
   What about making the desired tab (temporarily) current while
checking
   if the variable exists? Maybe manually naming the current tab is
  good
   enough (the user can change tabs manually too)? Or else, rather
than a
   separate variable in each tab, use a global array (a List, if you
  will),
   with as many items as there are tabs?
  
  
   Best regards,
   Tony.
 
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com


Re: Checking if a variable exists in a given tab

2006-08-03 Thread A.J.Mechelynck

Max Dyckhoff wrote:

I'm sure this is an easy one, I just can't find the answer anywhere.

I'm writing my own tabline function (based heavily on the one by Tony
Mechelynck, thanks!) and I want to be able to name a tab manually. The
best way I can think to do this is to have a tab local variable, such as
t:maxd_TabName. Only problem is that within the script I can only check
if that variable exists within the CURRENT tab.

So how can I get a tab local variable from a numbered tab? I've found
gettabwinvar(), but I just can't make it work (echo gettabwinvar(i, 0,
maxd_TabName) doesn't work).

Thanks in advance!

--
Max Dyckhoff 
AI Engineer

Bungie Studios






What about making the desired tab (temporarily) current while checking 
if the variable exists? Maybe manually naming the current tab is good 
enough (the user can change tabs manually too)? Or else, rather than a 
separate variable in each tab, use a global array (a List, if you will), 
with as many items as there are tabs?



Best regards,
Tony.


RE: Checking if a variable exists in a given tab

2006-08-03 Thread Max Dyckhoff
If by making the desired tab current you mean using :tabn {count} then
it isn't allowed. I imagine changing tabs within the tabline function
would be A Bad Thing, and would cause recursion.

I hadn't thought about using a global array of names, although it would
be a pain to maintain when one closes a tab (and I have better things to
program than that right now! :)

Anyone else know if you can get a tab local variable somehow?

Max


 -Original Message-
 From: A.J.Mechelynck [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 03, 2006 10:32 AM
 To: Max Dyckhoff
 Cc: vim@vim.org
 Subject: Re: Checking if a variable exists in a given tab
 
 Max Dyckhoff wrote:
  I'm sure this is an easy one, I just can't find the answer anywhere.
 
  I'm writing my own tabline function (based heavily on the one by
Tony
  Mechelynck, thanks!) and I want to be able to name a tab manually.
The
  best way I can think to do this is to have a tab local variable,
such as
  t:maxd_TabName. Only problem is that within the script I can only
check
  if that variable exists within the CURRENT tab.
 
  So how can I get a tab local variable from a numbered tab? I've
found
  gettabwinvar(), but I just can't make it work (echo gettabwinvar(i,
0,
  maxd_TabName) doesn't work).
 
  Thanks in advance!
 
  --
  Max Dyckhoff
  AI Engineer
  Bungie Studios
 
 
 
 
 
 What about making the desired tab (temporarily) current while checking
 if the variable exists? Maybe manually naming the current tab is
good
 enough (the user can change tabs manually too)? Or else, rather than a
 separate variable in each tab, use a global array (a List, if you
will),
 with as many items as there are tabs?
 
 
 Best regards,
 Tony.