Skip to content
Browse files

Modify log source format

  • Loading branch information...
1 parent eeb3fbe commit 547846e6e303e07834151f9cbd9c58a1361380fa @kmnk committed May 14, 2013
Showing with 16 additions and 11 deletions.
  1. +14 −10 autoload/unite/sources/giti/log.vim
  2. +2 −1 test/autoload/unite/sources/giti/test_log.vim
View
24 autoload/unite/sources/giti/log.vim
@@ -35,27 +35,31 @@ function! s:source.gather_candidates(args, context)"{{{
endfunction"}}}
" local functions {{{
-let s:word_format = '%s%s - %s, %s : %s'
+let s:word_format = '%-16s %- 20s %s %s'
function! s:build_word(val)"{{{
if !has_key(a:val, 'hash') || len(a:val.hash) <= 0
- return a:val.graph
+ return printf(s:word_format,
+\ '',
+\ '',
+\ a:val.graph,
+\ '',
+\ )
endif
return printf(s:word_format,
+\ strftime('%Y/%m/%d %H:%M', a:val.author.time),
+\ strlen(a:val.author.name) >= 20 ? a:val.author.name[0:18] . '~' : a:val.author.name,
\ a:val.graph,
-\ a:val.hash[0:6],
-\ a:val.author.name,
-\ a:val.author.date,
-\ a:val.subject
+\ a:val.subject,
\ )
endfunction"}}}
function! s:build_title()"{{{
return printf(s:word_format,
-\ '',
-\ 'hash',
+\ 'date',
\ 'author',
-\ 'relative date',
-\ 'subject')
+\ '',
+\ 'subject',
+\ )
endfunction"}}}
" }}}
View
3 test/autoload/unite/sources/giti/test_log.vim
@@ -5,8 +5,9 @@ let s:list = [{
\ 'graph' : 'foo',
\ 'hash' : 'barbarbarbarbar',
\ 'author' : {
-\ 'name' : 'hoge',
+\ 'name' : 'hogehogehogehogehoge',
\ 'date' : 'fuga',
+\ 'time' : '12345',
\ },
\ 'subject' : 'baz',
\}]

0 comments on commit 547846e

Please sign in to comment.
Something went wrong with that request. Please try again.