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

fix(command): fix SPLayer command

This commit is contained in:
wsdjeg 2022-06-19 19:51:51 +08:00
parent 5f2e2cf68e
commit 075d92f92a
2 changed files with 7 additions and 3 deletions

View File

@ -65,7 +65,11 @@ let s:CMP = SpaceVim#api#import('vim#compatible')
" < " <
function! SpaceVim#layers#load(layer, ...) abort function! SpaceVim#layers#load(layer, ...) abort
if a:layer ==# '-l' if a:layer ==# '-l'
call s:list_layers() if has('nvim')
lua require('spacevim.layer').load('-l')
else
call s:list_layers()
endif
return return
elseif empty(a:layer) || type(a:layer) !=# type('') elseif empty(a:layer) || type(a:layer) !=# type('')
return return

View File

@ -48,7 +48,7 @@ local function find_layers()
else else
url = name url = name
end end
if sp.fn.filereadable(sp.fn.expand('~/.SpaceVim/docs/layers/' .. url .. '.md')) then if sp.fn.filereadable(sp.fn.expand('~/.SpaceVim/docs/layers/' .. url .. '.md')) == 1 then
website = 'https://spacevim.org/layers/' .. url .. '/' website = 'https://spacevim.org/layers/' .. url .. '/'
else else
website = 'no exists' website = 'no exists'
@ -57,7 +57,7 @@ local function find_layers()
if status == 'loaded' then if status == 'loaded' then
table.insert(rst, '+ ' .. name .. ':' .. sp.fn['repeat'](' ', 25 - sp.fn.len(name)) .. status .. sp.fn['repeat'](' ', 10) .. website) table.insert(rst, '+ ' .. name .. ':' .. sp.fn['repeat'](' ', 25 - sp.fn.len(name)) .. status .. sp.fn['repeat'](' ', 10) .. website)
else else
table.insert(rst, '- ' .. name .. ':' .. sp.fn['repeat'](' ', 25 - sp.fn.len(name)) .. status .. sp.fn['repeat'](' ', 10) .. website) table.insert(rst, '- ' .. name .. ':' .. sp.fn['repeat'](' ', 21 - sp.fn.len(name)) .. status .. sp.fn['repeat'](' ', 10) .. website)
end end
end end
return rst return rst