diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-07-11 23:12:29 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-07-11 23:12:29 +0200 |
commit | 2cefbedaab00fe32c8f39718e9c64921f8660be2 (patch) | |
tree | 3d70d45b396091a1ad09d1cfaf6dc4c124424e03 | |
parent | b02cbe34686b913e70a64969c0a92998c7872009 (diff) | |
download | vim-2cefbedaab00fe32c8f39718e9c64921f8660be2.zip |
Fix: exists() was causing an autload script to be loaded.
-rw-r--r-- | runtime/doc/todo.txt | 2 | ||||
-rw-r--r-- | src/eval.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index e6c523ce6..9bf3d799e 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1099,8 +1099,6 @@ Vim 7.3: - Conceal feature: no update when moving to another window. (Dominique Pelle, 2010 Jul 5) Vince will look into it. Patches to possibly include: -- Patch to add diff functionality to 2html.vim. (Christian Brabandt, 2009 Dec - 15) - Win32: patch for better font scaling. (George Reilly, 2009 Mar 26) - Patch for completion of ":find" arguments. (Nazri Ramliy, 2009 Feb 22, 26) 8 For ":find" and ":sfind" expand files found in 'path'. diff --git a/src/eval.c b/src/eval.c index 294475824..9339e61db 100644 --- a/src/eval.c +++ b/src/eval.c @@ -126,6 +126,9 @@ static dictitem_T globvars_var; */ static hashtab_T compat_hashtab; +/* When using exists() don't auto-load a script. */ +static int no_autoload = FALSE; + /* * When recursively copying lists and dicts we need to remember which ones we * have done to avoid endless recursiveness. This unique ID is used for that. @@ -9724,6 +9727,8 @@ f_exists(argvars, rettv) int n = FALSE; int len = 0; + no_autoload = TRUE; + p = get_tv_string(&argvars[0]); if (*p == '$') /* environment variable */ { @@ -9790,6 +9795,8 @@ f_exists(argvars, rettv) } rettv->vval.v_number = n; + + no_autoload = FALSE; } #ifdef FEAT_FLOAT @@ -21281,6 +21288,10 @@ script_autoload(name, reload) int ret = FALSE; int i; + /* Return quickly when autoload disabled. */ + if (no_autoload) + return FALSE; + /* If there is no '#' after name[0] there is no package name. */ p = vim_strchr(name, AUTOLOAD_CHAR); if (p == NULL || p == name) |