From f551a7168850c8cdb2ec5c0c7cdddf42a28f26ef Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 11 Feb 2017 23:27:52 +0900 Subject: [PATCH] Add plugin to &rtp before running post-update hook with : prefix Close #593 --- plug.vim | 4 ++++ test/regressions.vader | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/plug.vim b/plug.vim index 4d0bb77..2a61349 100644 --- a/plug.vim +++ b/plug.vim @@ -820,6 +820,10 @@ function! s:do(pull, force, todo) let type = type(spec.do) if type == s:TYPE.string if spec.do[0] == ':' + if !get(s:loaded, name, 0) + let s:loaded[name] = 1 + call s:reorg_rtp() + endif call s:load_plugin(spec) try execute spec.do[1:] diff --git a/test/regressions.vader b/test/regressions.vader index 88a8a4f..3f7d0b0 100644 --- a/test/regressions.vader +++ b/test/regressions.vader @@ -332,3 +332,12 @@ Execute (Cursor moved to another window during post-update hook): AssertEqual 'empty', getline(1) q! q + +********************************************************************** +Execute (#593 Add plugin to &rtp before running post-update hook with : prefix): + call ReloadPlug() + call plug#begin() + Plug 'junegunn/vim-pseudocl', { 'on': 'XXX', 'do': ':let g:bar = pseudocl#complete#extract_words(''a b'')' } + call plug#end() + PlugInstall! + AssertEqual ['a', 'b'], g:bar