On 9/16/07, Nikolai Weibull <[EMAIL PROTECTED]> wrote:

> function bug#reproduce()
>   echo bug#number
> endfunction
>
> let bug#number = 1
>
> :call bug#reproduce()
>
> which will give you the following output (instead of 1):
>
> Error detected while processing function bug#new:
> line    1:
> E121: Undefined variable: bug#number
> E15: Invalid expression: bug#number
> 0
> Press ENTER or type command to continue
>
> Accessing the variable works fine, however:
>
> :echo bug#number
> 1
>
> So what's going on?

Argh.  Inside the function, you'll have to use the g: prefix.  Outside
it works fine.  Bram, could the lookup routines please be fixed to
deal with this automatically?  I realize that the whole g:, l:, b:,
... business makes "sense" for normal variable names, but when
referencing autoload variables, isn't the autload-namespacing stuff
enough?

  nikolai

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui