Skip to content

Commit

Permalink
Fix #29 add g:unite_source_tag_relative_fname
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed May 6, 2015
1 parent 9e8bbe5 commit 470eff8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
14 changes: 10 additions & 4 deletions autoload/unite/sources/tag.vim
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ let g:unite_source_tag_show_location =
let g:unite_source_tag_show_fname =
\ get(g:, 'unite_source_tag_show_fname', 1)

let g:unite_source_tag_relative_fname =
\ get(g:, 'unite_source_tag_relative_fname', 1)

" cache
let s:tagfile_cache = {}
let s:input_cache = {}
Expand Down Expand Up @@ -408,10 +411,13 @@ function! s:next(tagdata, line, name)

let abbr = s:truncate(name, g:unite_source_tag_max_name_length, 15, '..')
if g:unite_source_tag_show_fname
let abbr .= ' '.
\ s:truncate('@'.
\ (a:name ==# 'tag/include' ? fnamemodify(path, ':t') : filename),
\ g:unite_source_tag_max_fname_length, 10, '..')
let abbr .= ' '
let abbr .= s:truncate('@'.
\ fnamemodify(path, (
\ (a:name ==# 'tag/include'
\ || !g:unite_source_tag_relative_fname) ?
\ ':t' : ':~:.')),
\ g:unite_source_tag_max_fname_length, 10, '..')
endif
if g:unite_source_tag_show_location
if linenr
Expand Down
5 changes: 5 additions & 0 deletions doc/unite-tag.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ g:unite_source_tag_show_fname *g:unite_source_tag_show_fname*
The default value is 1.


g:unite_source_tag_relative_fname *g:unite_source_tag_relative_fname*
Use relative file name in the file name field.
The default value is 1.


==============================================================================
FAQ *unite-tag-faq*

Expand Down

0 comments on commit 470eff8

Please sign in to comment.