解決 vim 插件 taglist 報錯:Error detected while processing function

觸發場景

clipboard.png

a.php 標籤打開 taglist,而後打開 b.php 標籤,此時再切回到 a.php 標籤,vim 會報出一下錯誤信息:php

Error detected while processing function <SNR>29_Tlist_Refresh_Folds

解決辦法

下載 taglist 補丁:taglist.diff
補丁內容以下:(若不能下載,能夠複製此內容)html

diff --git a/vim/.vim/bundle/taglist/plugin/taglist.vim b/vim/.vim/bundle/taglist/plugin/taglist.vim
index 59901f6..74487a1 100644
--- a/vim/.vim/bundle/taglist/plugin/taglist.vim
+++ b/vim/.vim/bundle/taglist/plugin/taglist.vim
@@ -4097,6 +4097,11 @@ endfunction
 " window. Used after entering a tab. If this is not done, then the folds
 " are not properly created for taglist windows displayed in multiple tabs.
 function! s:Tlist_Refresh_Folds()
+
+    if g:Tlist_Show_One_File
+      return
+    endif
+
     let winnum = bufwinnr(g:TagList_title)
     if winnum == -1
         return

而後,應用此補丁:git

patch -p0 ~/.vim/plugged/taglist.vim/plugin/taglist.vim ~/Downloads/taglist.diff

注意: 插件位置由你所用的插件管理器決定,可能跟我不同。shell

參考:vim

相關文章
相關標籤/搜索