Undefined variable: s:default_coeff
frace opened this issue · comments
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 28 2015 21:47:25) / iTerm2 Build 2.9.20150728-nightly
Error detected while processing /Users/frace/.vim/plugged/limelight.vim/autoload/limelight.vim:
line 32:
E806: using Float as a String
E15: Invalid expression: 0.5
Vim(let):E121: Undefined variable: s:default_coeff
What's the output of :echo has('float')
?
:echo has('float')
1
vim --version | ag float
-balloon_eval +float +mouse_urxvt -tag_any_white
Hmm, I have no idea why it fails, how about this expression?
:let a = 0.5 | echo a * 2
Your expression gives me the same result. That's really strange. I just found out there's another plugin (sunset) suffering from this problem, too.
:let a = 0.5 | echo a * 2
E806: using Float as a String
E15: Invalid expression: 0.5 | echo a * 2
So I'd say the problem is somewhere else but not in your plugin...
It's a bug of Vim you have, and I remembered that I had the same issue before:
junegunn/vim-easy-align#27
So I applied the same workaround to Limelight, it should help.
Thank you for the quick fix! It works now.
I searched for the bug but it seems like reports are from around 2009-2011 - and there had been fixes for it. Strange that it bites me right now. :)
I just wanted to let you know that I hit the bug again while declaring
let g:limelight_default_coefficient = 0.7
I assume there is another location in limelight.vim where it is necessary to call str2float()
.
Since it is closely related I refrained from opening a new issue.
let g:limelight_default_coefficient = str2float('0.7')
Or so - Should be sufficient as a temporary solution. Thank you for the enlightenment. :)