mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 13:27:43 +00:00
vim-patch:7.4.1550
Problem: Cannot load packages early.
Solution: Add the ":packloadall" command.
2d8f56acb3
This commit is contained in:
@@ -73,6 +73,23 @@ describe('packadd', function()
|
||||
packadd! mytest
|
||||
call assert_equal(new_rtp, &rtp)
|
||||
endfunc
|
||||
|
||||
func Test_packloadall()
|
||||
let plugindir = &packpath . '/pack/mine/start/foo/plugin'
|
||||
call mkdir(plugindir, 'p')
|
||||
call writefile(['let g:plugin_foo_number = 1234'], plugindir . '/bar.vim')
|
||||
packloadall
|
||||
call assert_equal(1234, g:plugin_foo_number)
|
||||
|
||||
" only works once
|
||||
call writefile(['let g:plugin_bar_number = 4321'], plugindir . '/bar2.vim')
|
||||
packloadall
|
||||
call assert_false(exists('g:plugin_bar_number'))
|
||||
|
||||
" works when ! used
|
||||
packloadall!
|
||||
call assert_equal(4321, g:plugin_bar_number)
|
||||
endfunc
|
||||
]=])
|
||||
call('SetUp')
|
||||
end)
|
||||
@@ -91,6 +108,11 @@ describe('packadd', function()
|
||||
expected_empty()
|
||||
end)
|
||||
|
||||
it('works with :packloadall', function()
|
||||
call('Test_packloadall')
|
||||
expected_empty()
|
||||
end)
|
||||
|
||||
describe('command line completion', function()
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local screen
|
||||
|
||||
Reference in New Issue
Block a user