diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-08-06 19:01:55 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-08-06 19:01:55 +0200 |
commit | 66459b7c98c67f8a9d39de8f08e8e8f1fca0e359 (patch) | |
tree | 5e61d00ee66ba009f17ad1d490ce810ae89e6c2b /src/ex_cmds2.c | |
parent | d76a0c15f8bdbc901015879177fd5076d34c7a06 (diff) | |
download | vim-git-66459b7c98c67f8a9d39de8f08e8e8f1fca0e359.tar.gz |
patch 7.4.2164v7.4.2164
Problem: It is not possible to use plugins in an "after" directory to tune
the behavior of a package.
Solution: First load plugins from non-after directories, then packages and
finally plugins in after directories.
Reset 'loadplugins' before executing --cmd arguments.
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 2cebbebca..0e332dd42 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -3240,15 +3240,30 @@ do_in_path( rtp = rtp_copy; while (*rtp != NUL && ((flags & DIP_ALL) || !did_one)) { + size_t buflen; + /* Copy the path from 'runtimepath' to buf[]. */ copy_option_part(&rtp, buf, MAXPATHL, ","); + buflen = STRLEN(buf); + + /* Skip after or non-after directories. */ + if (flags & (DIP_NOAFTER | DIP_AFTER)) + { + int is_after = buflen >= 5 + && STRCMP(buf + buflen - 5, "after") == 0; + + if ((is_after && (flags & DIP_NOAFTER)) + || (!is_after && (flags & DIP_AFTER))) + continue; + } + if (name == NULL) { (*callback)(buf, (void *) &cookie); if (!did_one) did_one = (cookie == NULL); } - else if (STRLEN(buf) + STRLEN(name) + 2 < MAXPATHL) + else if (buflen + STRLEN(name) + 2 < MAXPATHL) { add_pathsep(buf); tail = buf + STRLEN(buf); @@ -3512,6 +3527,7 @@ static int did_source_packages = FALSE; /* * ":packloadall" * Find plugins in the package directories and source them. + * "eap" is NULL when invoked during startup. */ void ex_packloadall(exarg_T *eap) |