On Jul 14, 12:10 pm, Charles Campbell <[email protected]>
wrote:
> Functions may be made accessible only to the script that they're defined
> in.  See  :help local-function  .
>

Right, but that's not going to avoid errors for multiple definitions
due to sourcing the same script multiple times, in this example
because the function is inside a ftplugin and multiple files are
loaded.

Either use ! as you have, or check for the function's existence before
defining it, like this:

if !exists("*Foo")
  function Foo()
    ...
  endfunction
endif

(substitute s:Foo instead of just Foo to use the local functions Dr.
Chip is referring to)
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to