From 470eff827c8540bd6388db08d276089b0c6e2990 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Thu, 7 May 2015 07:10:22 +0900 Subject: [PATCH] Fix #29 add g:unite_source_tag_relative_fname --- autoload/unite/sources/tag.vim | 14 ++++++++++---- doc/unite-tag.txt | 5 +++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/autoload/unite/sources/tag.vim b/autoload/unite/sources/tag.vim index d4f3fa6..df4d224 100644 --- a/autoload/unite/sources/tag.vim +++ b/autoload/unite/sources/tag.vim @@ -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 = {} @@ -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 diff --git a/doc/unite-tag.txt b/doc/unite-tag.txt index 1d564b8..d4176cb 100644 --- a/doc/unite-tag.txt +++ b/doc/unite-tag.txt @@ -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*