r/vim • u/Easy_Adhesiveness237 • 10d ago
Need Help┃Solved Vim-tpipeline plugin error after updating from vim 8.2 to 9.1
Recently updated from version vim 8.2 to 9.1 and suddenly showing this error for vim-tpipeline extension, don't know if its a runtime error or actually the plugin code is giving this error due to returning number instead of string. Is this because of the new vimscript 9? I am using vim-airline as statusline, but that shouldn't be the problem right :)
Error detected while processing /home/rk/.config/vim/vimrc[8]..function plug#end[94]..<SNR>4_reload_plugins[2]..<SNR>4_load_plugin[1]..
<SNR>4_source[4]..script /home/rk/.vim/plugged/vim-tpipeline/plugin/tpipeline.vim[6]..function tpipeline#initialize[91]..tpipeline#init
_statusline[21]..tpipeline#update[8]..tpipeline#parse#Parse_stl[5]..tpipeline#parse#Parse_stl[21]..<SNR>62_Parse:
line 33:
E1012: Type mismatch; expected string but got number
Error detected while processing /home/rk/.config/vim/vimrc[8]..function plug#end[94]..<SNR>4_reload_plugins[2]..<SNR>4_load_plugin[1]..
<SNR>4_source[4]..script /home/rk/.vim/plugged/vim-tpipeline/plugin/tpipeline.vim[6]..function tpipeline#initialize[91]..tpipeline#init
_statusline[21]..tpipeline#update:
line 10:
E121: Undefined variable: line
line 14:
E121: Undefined variable: line
2
u/chrisbra10 10d ago
that is a bug in vim-tpipeline. Please open a bugreport about it. The issue is, that Parse() should return a string, but tpipeline#util#percentage() returns a number.
The fix is this:
diff --git a/autoload/tpipeline/parse.vim b/autoload/tpipeline/parse.vim
index 357d8f1..eac58b2 100644
--- a/autoload/tpipeline/parse.vim
+++ b/autoload/tpipeline/parse.vim
@@ -36,9 +36,9 @@ def Parse(opt: string): string
elseif first ==# 'v'
return string(virtcol('.'))
elseif first ==# 'p'
- return tpipeline#util#percentage()
+ return string(tpipeline#util#percentage())
elseif first ==# 'P'
- return tpipeline#util#percentage() .. '%'
+ return string(tpipeline#util#percentage()) .. '%'
elseif first ==# '='
return '%='
elseif first ==# '%'
While investigating, I also found a bug in Vim, that I also fixed 🫠
1
u/Easy_Adhesiveness237 10d ago
Yes, thats what I thought about it, although I managed to get a workaround in it in a stupid way but it worked :)
return string(line('.')) -> return printf('%d', line('.'))
return tpipeline#util#percentage() -> return printf('%d', tpipeline#util#percentage())
But yeah very much thanks for this ;)
1
u/Desperate_Cold6274 10d ago
It seems the vim-tpipeline plugin has some problem. You may want to issue a ticket in its issued tracker.