giann / croissant

🥐 A Lua REPL and debugger
MIT License
407 stars 10 forks source link

Attempt to perform arithmetic on a nil value (field 'y') #9

Open Lessica opened 2 years ago

Lessica commented 2 years ago

See https://github.com/giann/sirocco/issues/2. When I paste multiple lines of codes into the REPL of croissant, even in a do...end block, I got the same problem. Problem exists on macOS 12.4 with Terminal/iTerm2/VSCode.

lua: /usr/local/lib/sirocco/prompt.lua:355: attempt to perform arithmetic on a nil value (field 'y')
stack traceback:
    /usr/local/lib/sirocco/prompt.lua:355: in function 'croissant.luaprompt.update'
    /usr/local/lib/sirocco/prompt.lua:431: in function 'croissant.luaprompt.ask'
    /usr/local/lib/croissant/repl.lua:22: in function 'croissant.repl'
    /usr/local/bin/croissant:52: in local 'route'
    /usr/local/bin/croissant:56: in main chunk
    [C]: in ?

iTerm2

# rachel @ ZhengPro in ~[22:55:25]
$ echo -e "\033[6n" | cat

# rachel @ ZhengPro in ~[22:55:28]
$ ;1R
# rachel @ ZhengPro in ~[22:56:01]
$ echo $TERM
xterm-256color

Terminal

# rachel @ ZhengPro in ~ [23:02:56] 
$ echo -e "\033[6n" | cat

^[[5;1R%                                                                        
# rachel @ ZhengPro in ~ [23:02:58] 
$ 1R
# rachel @ ZhengPro in ~ [23:02:58] 
$ echo $TERM             
xterm-256color
Lessica commented 2 years ago

https://user-images.githubusercontent.com/5410705/173788217-e32a10cf-ae5d-48c0-8503-67eb9268004b.mov