Skip to content

Instantly share code, notes, and snippets.

@choplin
Created October 30, 2011 06:44
Show Gist options
  • Save choplin/1325593 to your computer and use it in GitHub Desktop.
Save choplin/1325593 to your computer and use it in GitHub Desktop.
vcs.vim api-log plugin
let s:save_cpo = &cpo
set cpo&vim
let s:api = {
\ 'name': 'log',
\ }
function! s:api.depends()
return ['log']
endfunction
function! s:api.execute(type)
let log = call(a:type.log, a:000, a:type)
let ret = []
for line in split(log, '\n')
let tmp = split(line)
call add(ret, {
\ 'revision': tmp[0],
\ 'message': join(tmp[1:], ' '),
\ })
endfor
return ret
endfunction
function! vcs#api#log#load()
return copy(s:api)
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment