Problem: Python: Script is auto-loaded on function creation.
Solution: Python patch 27. (ZyX)
# endif
prof_self_cmp __ARGS((const void *s1, const void *s2));
#endif
+static int script_autoload __ARGS((char_u *name, int reload));
static char_u *autoload_name __ARGS((char_u *name));
static void cat_func_name __ARGS((char_u *buf, ufunc_T *fp));
static void func_free __ARGS((ufunc_T *fp));
static void sortFunctions __ARGS(());
#endif
-
-/* Character used as separated in autoload function/variable names. */
-#define AUTOLOAD_CHAR '#'
-
/*
* Initialize the global and v: variables.
*/
* If "name" has a package name try autoloading the script for it.
* Return TRUE if a package was loaded.
*/
- int
+ static int
script_autoload(name, reload)
char_u *name;
int reload; /* load script again when already loaded */
func_ref(self->name);
}
else
- {
- self->name = get_expanded_name(name, TRUE);
- if (self->name == NULL)
+ if ((self->name = get_expanded_name(name,
+ vim_strchr(name, AUTOLOAD_CHAR) == NULL))
+ == NULL)
{
- if (script_autoload(name, TRUE) && !aborting())
- self->name = get_expanded_name(name, TRUE);
- if (self->name == NULL)
- {
- PyErr_SetString(PyExc_ValueError, _("function does not exist"));
- return NULL;
- }
+ PyErr_SetString(PyExc_ValueError, _("function does not exist"));
+ return NULL;
}
- }
return (PyObject *)(self);
}
void ex_oldfiles __ARGS((exarg_T *eap));
int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen));
char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags));
-int script_autoload __ARGS((char_u *name, int reload));
/* vim: set ft=c : */
>> FunctionConstructor
vim.Function("123"):(<type 'exceptions.ValueError'>, ValueError('unnamed function does not exist',))
vim.Function("xxx_non_existent_function_xxx"):(<type 'exceptions.ValueError'>, ValueError('function does not exist',))
-vim.Function("xxx#non#existent#function#xxx"):(<type 'exceptions.ValueError'>, ValueError('function does not exist',))
+vim.Function("xxx#non#existent#function#xxx"):NOT FAILED
>> FunctionCall
>>> Testing StringToChars using f({%s : 1})
f({1 : 1}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
>> FunctionConstructor
vim.Function("123"):(<class 'ValueError'>, ValueError('unnamed function does not exist',))
vim.Function("xxx_non_existent_function_xxx"):(<class 'ValueError'>, ValueError('function does not exist',))
-vim.Function("xxx#non#existent#function#xxx"):(<class 'ValueError'>, ValueError('function does not exist',))
+vim.Function("xxx#non#existent#function#xxx"):NOT FAILED
>> FunctionCall
>>> Testing StringToChars using f({%s : 1})
f({1 : 1}):(<class 'TypeError'>, TypeError('object must be string',))
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1068,
/**/
1067,
/**/
#define SREQ_WIN 1 /* Request window-local option */
#define SREQ_BUF 2 /* Request buffer-local option */
+/* Character used as separated in autoload function/variable names. */
+#define AUTOLOAD_CHAR '#'
+
#endif /* VIM__H */