mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:30:05 +08:00
fix(command): fix SPLayer
command
This commit is contained in:
parent
5f2e2cf68e
commit
075d92f92a
@ -65,7 +65,11 @@ let s:CMP = SpaceVim#api#import('vim#compatible')
|
||||
" <
|
||||
function! SpaceVim#layers#load(layer, ...) abort
|
||||
if a:layer ==# '-l'
|
||||
call s:list_layers()
|
||||
if has('nvim')
|
||||
lua require('spacevim.layer').load('-l')
|
||||
else
|
||||
call s:list_layers()
|
||||
endif
|
||||
return
|
||||
elseif empty(a:layer) || type(a:layer) !=# type('')
|
||||
return
|
||||
|
@ -48,7 +48,7 @@ local function find_layers()
|
||||
else
|
||||
url = name
|
||||
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 .. '/'
|
||||
else
|
||||
website = 'no exists'
|
||||
@ -57,7 +57,7 @@ local function find_layers()
|
||||
if status == 'loaded' then
|
||||
table.insert(rst, '+ ' .. name .. ':' .. sp.fn['repeat'](' ', 25 - sp.fn.len(name)) .. status .. sp.fn['repeat'](' ', 10) .. website)
|
||||
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
|
||||
return rst
|
||||
|
Loading…
Reference in New Issue
Block a user