Create autoload/bug.vim:

let s:cpo_save = &cpo
set cpo&vim

function bug#reproduce()
  echo bug#number
endfunction

let bug#number = 1

let s:cpo_save = &cpo
set cpo&vim

Start vim and run

: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?

  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