1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:20:04 +08:00

Fix api import (#2418)

This commit is contained in:
Wang Shidong 2019-01-07 09:41:15 +08:00 committed by GitHub
parent bb928a13f5
commit f8b5fca38c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,9 @@
let s:apis = {}
" the api itself is a dict, and it will be changed when user use the api. so
" every time when request a api, we should provide an clean api.
""
"@public
@ -39,7 +42,7 @@ function! SpaceVim#api#import(name) abort
let p = {}
try
let p = SpaceVim#api#{a:name}#get()
let s:apis[a:name] = p
let s:apis[a:name] = deepcopy(p)
catch /^Vim\%((\a\+)\)\=:E117/
endtry
return p

View File

@ -20,3 +20,4 @@ Execute ( SpaceVim api: logger ):
AssertEqual len(split(log.view(1), "\n")), 7
AssertEqual len(split(log.view(2), "\n")), 6
AssertEqual len(split(log.view(3), "\n")), 4
unlet log