Skip to content

Commit

Permalink
Fix Error spf13#716 when a plugin is already removed
Browse files Browse the repository at this point in the history
  • Loading branch information
compleatguru committed Oct 21, 2017
1 parent fcd94c9 commit 06cdf2f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .vim_plug.unplug
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
function! s:deregister(repo)
let repo = substitute(a:repo, '[\/]\+$', '', '')
let name = fnamemodify(repo, ':t:s?\.git$??')
call remove(g:plugs, name)
call remove(g:plugs_order, index(g:plugs_order, name))

try
call remove(g:plugs, name)
call remove(g:plugs_order, index(g:plugs_order, name))
catch /^Vim\%((\a\+)\)\=:E716/ " Key Not present in Dictionary
"echom name . ' already removed'
endtry

endfunction

command! -nargs=1 -bar UnPlug call s:deregister(<args>)

0 comments on commit 06cdf2f

Please sign in to comment.