1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Add more debug info (#3828)

This commit is contained in:
Wang Shidong 2020-09-24 21:21:59 +08:00 committed by GitHub
parent 70d882ae15
commit 31753fc5bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@
"=============================================================================
let s:CMP = SpaceVim#api#import('vim#compatible')
let s:STR = SpaceVim#api#import('data#string')
function! SpaceVim#issue#report() abort
call s:open()
@ -49,7 +50,7 @@ function! s:template() abort
\ '- vim version: ' . (has('nvim') ? '-' : s:CMP.version()),
\ '- neovim version: ' . (has('nvim') ? s:CMP.version() : '-'),
\ '- SpaceVim version: ' . g:spacevim_version,
\ '- SpaceVim status: ',
\ '- SpaceVim status: ' . s:spacevim_version(),
\ '',
\ '```'
\ ]
@ -107,3 +108,17 @@ function! SpaceVim#issue#close(id) abort
let password = input('github password:')
call github#api#issues#Edit('SpaceVim', 'SpaceVim', a:id, username, password, issue)
endfunction
function! s:spacevim_version() abort
let pwd = getcwd()
try
exe 'cd ' . fnamemodify(g:_spacevim_root_dir, ':p:h')
let status = s:CMP.system('git rev-parse --short HEAD')
catch
exe 'cd ~/.SpaceVim'
let status = s:CMP.system('git rev-parse --short HEAD')
endtry
exe 'cd ' . pwd
return s:STR.trim(status)
endfunction