From 6716572b30e3cb6aa214a9c69e7fa480170d14f6 Mon Sep 17 00:00:00 2001 From: Michael Monsivais Date: Fri, 19 Nov 2021 10:15:15 -0700 Subject: [PATCH] taglist: load taglist variants only once Because Tlist_Get_Filenames() only exists within yegappan/taglist, TlistUpdate was being envoked on every call when using other taglist versions.(Like vim-scripts/taglist.) This caused visual artifacts and slowdowns. We now check for a function from both taglist variants to see if either one has been loaded. --- autoload/airline/extensions/taglist.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/airline/extensions/taglist.vim b/autoload/airline/extensions/taglist.vim index 93c7bb82..dffa8d6e 100644 --- a/autoload/airline/extensions/taglist.vim +++ b/autoload/airline/extensions/taglist.vim @@ -10,15 +10,15 @@ endif function! airline#extensions#taglist#currenttag() " Update tag list if taglist is not loaded (else we get an empty tag name) + " Load yegappan/taglist and vim-scripts/taglist.vim only once. let tlist_updated = v:false - if !exists('*Tlist_Get_Filenames()') + if !exists('*taglist#Tlist_Get_Tagname_By_Line()') && !exists('*Tlist_Get_Tagname_By_Line()') TlistUpdate let tlist_updated = v:true endif - if !tlist_updated + if !tlist_updated && exists('*Tlist_Get_Filenames()') if stridx(Tlist_Get_Filenames(), expand('%:p')) < 0 TlistUpdate - let tlist_updated = v:true endif endif " Is this function is not present it'means you use the old vertsion of