Permalink
Browse files

add date column for log source.

  • Loading branch information...
1 parent d769066 commit 5203e5dfe50b1c46685783f1fa9da79da4219068 @hrsh7th committed Oct 2, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 autoload/unite/sources/vcs/log.vim
  2. +1 −1 autoload/vcs/git/log.vim
@@ -28,9 +28,10 @@ function! s:source.gather_candidates(args, context)
let logs = vcs#vcs('log', [path])
let revisionlen = max(map(copy(logs), "strlen(v:val.revision)"))
+ let datelen = max(map(copy(logs), "strlen(split(v:val.date, ' ')[0])"))
let authorlen = max(map(copy(logs), "strlen(split(v:val.author, ' ')[0])"))
return map(logs, "{
- \ 'word': s:padding(v:val.revision, revisionlen) . ' | '. s:padding(split(v:val.author, ' ')[0], authorlen) . ' | ' . v:val.message,
+ \ 'word': s:padding(v:val.revision, revisionlen) . ' | '. s:padding(v:val.date, datelen) . ' | '. s:padding(v:val.author, authorlen) . ' | ' . v:val.message,
\ 'action__path': v:val.path,
\ 'action__revision': v:val.revision,
\ 'action__prev_revision': v:val.prev_revision,
@@ -34,7 +34,7 @@ function! s:parse(target, list)
\ "revision": v:val[0],
\ "prev_revision": v:val[1],
\ "author": v:val[2],
- \ "date": v:val[4],
+ \ "date": join(split(v:val[4], " ")[0:1], " "),
\ "message": v:val[5],
\ "path": a:target
\ }')

0 comments on commit 5203e5d

Please sign in to comment.