Mercurial > vim
comparison src/userfunc.c @ 27043:15f40772e10a v8.2.4050
patch 8.2.4050: Vim9: need to prefix every item in an autoload script
Commit: https://github.com/vim/vim/commit/dc4451df61a6aa12a0661817b7094fb32f09e11d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 9 21:36:37 2022 +0000
patch 8.2.4050: Vim9: need to prefix every item in an autoload script
Problem: Vim9: need to prefix every item in an autoload script.
Solution: First step in supporting "vim9script autoload" and "import
autoload".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 09 Jan 2022 22:45:04 +0100 |
parents | c9474ae175f4 |
children | 140102677c12 |
comparison
equal
deleted
inserted
replaced
27042:8fc14d120630 | 27043:15f40772e10a |
---|---|
1606 if (STRNCMP(name, "s:", 2) == 0) | 1606 if (STRNCMP(name, "s:", 2) == 0) |
1607 { | 1607 { |
1608 p = name + 2; | 1608 p = name + 2; |
1609 len -= 2; | 1609 len -= 2; |
1610 } | 1610 } |
1611 import = find_imported(p, len, NULL); | 1611 import = find_imported(p, len, FALSE, NULL); |
1612 | 1612 |
1613 // imported function from another script | 1613 // imported function from another script |
1614 if (import != NULL) | 1614 if (import != NULL) |
1615 { | 1615 { |
1616 name[len] = NUL; | 1616 name[len] = NUL; |
4077 return NULL; | 4077 return NULL; |
4078 } | 4078 } |
4079 else | 4079 else |
4080 eap->skip = TRUE; | 4080 eap->skip = TRUE; |
4081 } | 4081 } |
4082 | |
4083 // if (is_export) | |
4084 // name = may_prefix_autoload(name); | |
4082 } | 4085 } |
4083 | 4086 |
4084 // An error in a function call during evaluation of an expression in magic | 4087 // An error in a function call during evaluation of an expression in magic |
4085 // braces should not cause the function not to be defined. | 4088 // braces should not cause the function not to be defined. |
4086 saved_did_emsg = did_emsg; | 4089 saved_did_emsg = did_emsg; |
4361 fp = find_func_even_dead(name, is_global, NULL); | 4364 fp = find_func_even_dead(name, is_global, NULL); |
4362 if (vim9script) | 4365 if (vim9script) |
4363 { | 4366 { |
4364 char_u *uname = untrans_function_name(name); | 4367 char_u *uname = untrans_function_name(name); |
4365 | 4368 |
4366 import = find_imported(uname == NULL ? name : uname, 0, NULL); | 4369 import = find_imported(uname == NULL ? name : uname, 0, FALSE, NULL); |
4367 } | 4370 } |
4368 | 4371 |
4369 if (fp != NULL || import != NULL) | 4372 if (fp != NULL || import != NULL) |
4370 { | 4373 { |
4371 int dead = fp != NULL && (fp->uf_flags & FC_DEAD); | 4374 int dead = fp != NULL && (fp->uf_flags & FC_DEAD); |