Mercurial > vim
comparison src/testdir/test_startup.vim @ 11457:5a1656d79707 v8.0.0612
patch 8.0.0612: pack dirs are added to 'runtimepath' too late
commit https://github.com/vim/vim/commit/ce876aaa9a250a5a0d0e34b3a2625e51cf9bf5bb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 4 17:47:42 2017 +0200
patch 8.0.0612: pack dirs are added to 'runtimepath' too late
Problem: Package directories are added to 'runtimepath' only after loading
non-package plugins.
Solution: Split off the code to add package directories to 'runtimepath'.
(Ingo Karkat, closes #1680)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 04 Jun 2017 18:00:04 +0200 |
parents | 6e1c19d3de03 |
children | 42cd59477698 |
comparison
equal
deleted
inserted
replaced
11456:48ead0fc0368 | 11457:5a1656d79707 |
---|---|
57 endif | 57 endif |
58 | 58 |
59 call delete('Xtestout') | 59 call delete('Xtestout') |
60 call delete('Xhere', 'rf') | 60 call delete('Xhere', 'rf') |
61 call delete('Xafter', 'rf') | 61 call delete('Xafter', 'rf') |
62 endfunc | |
63 | |
64 func Test_pack_in_rtp_when_plugins_run() | |
65 if !has('packages') | |
66 return | |
67 endif | |
68 let before = [ | |
69 \ 'set nocp viminfo+=nviminfo', | |
70 \ 'set guioptions+=M', | |
71 \ 'let $HOME = "/does/not/exist"', | |
72 \ 'set loadplugins', | |
73 \ 'set rtp=Xhere', | |
74 \ 'set packpath=Xhere', | |
75 \ 'set nomore', | |
76 \ ] | |
77 let after = [ | |
78 \ 'quit', | |
79 \ ] | |
80 call mkdir('Xhere/plugin', 'p') | |
81 call writefile(['redir! > Xtestout', 'silent set runtimepath?', 'silent! call foo#Trigger()', 'redir END'], 'Xhere/plugin/here.vim') | |
82 call mkdir('Xhere/pack/foo/start/foobar/autoload', 'p') | |
83 call writefile(['function! foo#Trigger()', 'echo "autoloaded foo"', 'endfunction'], 'Xhere/pack/foo/start/foobar/autoload/foo.vim') | |
84 | |
85 if RunVim(before, after, '') | |
86 | |
87 let lines = filter(readfile('Xtestout'), '!empty(v:val)') | |
88 call assert_match('Xhere[/\\]pack[/\\]foo[/\\]start[/\\]foobar', get(lines, 0)) | |
89 call assert_match('autoloaded foo', get(lines, 1)) | |
90 endif | |
91 | |
92 call delete('Xtestout') | |
93 call delete('Xhere', 'rf') | |
62 endfunc | 94 endfunc |
63 | 95 |
64 func Test_help_arg() | 96 func Test_help_arg() |
65 if !has('unix') && has('gui') | 97 if !has('unix') && has('gui') |
66 " this doesn't work with gvim on MS-Windows | 98 " this doesn't work with gvim on MS-Windows |