Created
October 30, 2011 06:44
-
-
Save choplin/1325593 to your computer and use it in GitHub Desktop.
vcs.vim api-log plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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