mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 11:50:05 +08:00
Fix 1232
This commit is contained in:
parent
57b6589c6f
commit
81aec3c393
@ -1,7 +1,8 @@
|
|||||||
let s:self = {}
|
let s:self = {}
|
||||||
|
|
||||||
|
let s:CMP = SpaceVim#api#import('vim#compatible')
|
||||||
|
|
||||||
if has('python')
|
if s:CMP.has('python')
|
||||||
" @vimlint(EVL103, 1, a:text)
|
" @vimlint(EVL103, 1, a:text)
|
||||||
function! s:self.encode(text) abort
|
function! s:self.encode(text) abort
|
||||||
py import vim
|
py import vim
|
||||||
@ -116,7 +117,7 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function! SpaceVim#api#data#base64#get()
|
function! SpaceVim#api#data#base64#get() abort
|
||||||
|
|
||||||
return deepcopy(s:self)
|
return deepcopy(s:self)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ function! SpaceVim#api#vim#compatible#get() abort
|
|||||||
\ 'system' : '',
|
\ 'system' : '',
|
||||||
\ 'systemlist' : '',
|
\ 'systemlist' : '',
|
||||||
\ 'version' : '',
|
\ 'version' : '',
|
||||||
|
\ 'has' : '',
|
||||||
\ 'globpath' : '',
|
\ 'globpath' : '',
|
||||||
\ },
|
\ },
|
||||||
\ "function('s:' . v:key)"
|
\ "function('s:' . v:key)"
|
||||||
@ -111,4 +112,32 @@ else
|
|||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
function! s:has(feature) abort
|
||||||
|
if a:feature ==# 'python'
|
||||||
|
try
|
||||||
|
py import vim
|
||||||
|
return 1
|
||||||
|
catch
|
||||||
|
return 0
|
||||||
|
endtry
|
||||||
|
elseif a:feature ==# 'python3'
|
||||||
|
try
|
||||||
|
py3 import vim
|
||||||
|
return 1
|
||||||
|
catch
|
||||||
|
return 0
|
||||||
|
endtry
|
||||||
|
elseif a:feature ==# 'pythonx'
|
||||||
|
try
|
||||||
|
pyx import vim
|
||||||
|
return 1
|
||||||
|
catch
|
||||||
|
return 0
|
||||||
|
endtry
|
||||||
|
else
|
||||||
|
return has(a:feature)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" vim:set et sw=2 cc=80:
|
" vim:set et sw=2 cc=80:
|
||||||
|
Loading…
Reference in New Issue
Block a user