fix tagbar buffer detection (ref: #405)

This commit is contained in:
itchyny
2019-12-27 18:13:16 +09:00
parent 6daec38c1d
commit 0ba8888c0e
2 changed files with 4 additions and 6 deletions

View File

@@ -330,7 +330,7 @@ let g:lightline = {
\ }
function! LightlineMode()
return expand('%:t') ==# '__Tagbar__' ? 'Tagbar':
return expand('%:t') =~# '^__Tagbar__' ? 'Tagbar':
\ expand('%:t') ==# 'ControlP' ? 'CtrlP' :
\ &filetype ==# 'unite' ? 'Unite' :
\ &filetype ==# 'vimfiler' ? 'VimFiler' :

View File

@@ -4,7 +4,7 @@ Version: 0.1
Author: itchyny (https://github.com/itchyny)
License: MIT License
Repository: https://github.com/itchyny/lightline.vim
Last Change: 2019/08/14 10:46:55.
Last Change: 2019/12/27 18:11:21.
CONTENTS *lightline-contents*
@@ -825,8 +825,7 @@ For users who uses lots of plugins:
function! LightlineFilename()
let fname = expand('%:t')
return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
\ fname == '__Tagbar__' ? g:lightline.fname :
\ fname =~ '__Gundo\|NERD_tree' ? '' :
\ fname =~# '^__Tagbar__\|__Gundo\|NERD_tree' ? '' :
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
@@ -861,7 +860,7 @@ For users who uses lots of plugins:
function! LightlineMode()
let fname = expand('%:t')
return fname == '__Tagbar__' ? 'Tagbar' :
return fname =~# '^__Tagbar__' ? 'Tagbar' :
\ fname == 'ControlP' ? 'CtrlP' :
\ fname == '__Gundo__' ? 'Gundo' :
\ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
@@ -902,7 +901,6 @@ For users who uses lots of plugins:
let g:tagbar_status_func = 'TagbarStatusFunc'
function! TagbarStatusFunc(current, sort, fname, ...) abort
let g:lightline.fname = a:fname
return lightline#statusline(0)
endfunction