From 1f8ddcf6d7b51072d0667f5b690597fe539d245a Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Sat, 1 Sep 2018 11:18:47 +0800 Subject: [PATCH] Add old vim support (#2116) --- README.cn.md | 2 +- README.md | 2 +- autoload/SpaceVim/plugins.vim | 8 +++++--- autoload/SpaceVim/plugins/manager.vim | 10 +++++++++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.cn.md b/README.cn.md index 45d3c6812..40013d78a 100644 --- a/README.cn.md +++ b/README.cn.md @@ -60,7 +60,7 @@ SpaceVim 内置了一种特殊的模式,Iedit 模式,这种模式提供了 该模式支持两种状态 :`iedit-Normal` 和 `iedit-Insert`。默认情况下,多光标输入时,`iedit-normal` 模式状态栏时是红色,而 `iedit-insert` 模式时是绿色,当然这根据所选择主题决定。 -![iedit mode](https://user-images.githubusercontent.com/13142418/37598530-752bf6e4-2b50-11e8-9b91-4a18cd87afa0.gif) +![iedit mode](https://user-images.githubusercontent.com/13142418/44941560-be2a9800-add2-11e8-8fa5-e6118ff9ddcb.gif) ### 高亮光标下的函数 diff --git a/README.md b/README.md index 98f948037..c57a5778c 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ SpaceVim uses powerful iedit mode to quick edit multiple occurrences of a symbol The default color for iedit is `red`/`green` which is based on the current colorscheme. -![iedit mode](https://user-images.githubusercontent.com/13142418/37873892-c76afb14-2fea-11e8-9149-aa955b8265f1.gif) +![iedit mode](https://user-images.githubusercontent.com/13142418/44941560-be2a9800-add2-11e8-8fa5-e6118ff9ddcb.gif) **Highlight cursor symbol** diff --git a/autoload/SpaceVim/plugins.vim b/autoload/SpaceVim/plugins.vim index 06d9038ab..f2cd77c13 100644 --- a/autoload/SpaceVim/plugins.vim +++ b/autoload/SpaceVim/plugins.vim @@ -63,9 +63,11 @@ function! s:loadLayerConfig(layer) abort endfunction function! s:disable_plugins(plugin_list) abort - for name in a:plugin_list - call dein#disable(name) - endfor + if g:spacevim_plugin_manager ==# 'dein' + for name in a:plugin_list + call dein#disable(name) + endfor + endif endfunction function! SpaceVim#plugins#get(...) abort diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index 4b6f6cf5a..84b1f441e 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -264,6 +264,9 @@ function! s:on_pull_exit(id, data, event) abort else let id = a:id endif + if !has_key(s:pulling_repos, id) + return + endif if a:data == 0 && a:event ==# 'exit' call s:msg_on_updated_done(s:pulling_repos[id].name) else @@ -362,6 +365,9 @@ function! s:on_install_exit(id, data, event) abort else let id = a:id endif + if !has_key(s:pulling_repos, id) + return + endif if a:data == 0 && a:event ==# 'exit' call s:msg_on_install_done(s:pulling_repos[id].name) else @@ -374,7 +380,7 @@ function! s:on_install_exit(id, data, event) abort call s:build(s:pulling_repos[id]) else let s:pct_done += 1 - call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')') + call s:set_buf_line(s:plugin_manager_buffer, 1, 'Installing plugins (' . s:pct_done . '/' . s:total . ')') call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar()) endif call remove(s:pulling_repos, string(id)) @@ -404,6 +410,8 @@ function! s:pull(repo) abort call s:msg_on_start(a:repo.name) redraw! call s:JOB.start(argv,{ + \ 'on_stderr' : function('s:on_install_stdout'), + \ 'cwd' : a:repo.path, \ 'on_exit' : function('s:on_pull_exit') \ })