m00qek / baleia.nvim

Colorize text with ANSI escape sequences (8, 16, 256 or TrueColor)
138 stars 5 forks source link

Attempt to perform arithmetic on upvalue 'ansi' (a table value) #6

Closed daveyarwood closed 2 years ago

daveyarwood commented 2 years ago

Today, I started seeing this error pop up while running tests via Conjure:

Error executing vim.schedule lua callback: /home/dave/.vim/bundle/baleia.nvim/lua/baleia/styles.lua:97: attempt to perform arithmetic on upvalue 'ansi' (a table value)
stack traceback:
        /home/dave/.vim/bundle/baleia.nvim/lua/baleia/styles.lua:97: in function 'to_style'
        /home/dave/.vim/bundle/baleia.nvim/lua/baleia/locations.lua:14: in function 'linelocs'
        /home/dave/.vim/bundle/baleia.nvim/lua/baleia/locations.lua:33: in function 'extract'
        /home/dave/.vim/bundle/baleia.nvim/lua/baleia/highlight.lua:57: in function 'all'
        /home/dave/.vim/bundle/baleia.nvim/lua/baleia.lua:12: in function </home/dave/.vim/bundle/baleia.nvim/lua/baleia.lua:11>

I tried following the instructions here to collect logs, but when I ran :BaleiaLogs, I got this error:

E121: Undefined variable: g:baleia
m00qek commented 2 years ago

I'm so sorry, I feel like you're getting all the bugs! First of all, the instructions have a typo: instead of g:baleia use s:baleia

m00qek commented 2 years ago

I think in this case you were trying to parse an escape code that baleia does not know how to handle

m00qek commented 2 years ago

FIxed by https://github.com/m00qek/baleia.nvim/commit/eaad030fac5cb7a870d7e70dd05696a936c6022b