luvit/luvit

Luvit's repl weird behavior when writing a long code

Bilal2453 opened this issue · 3 comments

Pressing backspace/arrow keys while writing a code that's longer than the terminal width will result in duplicated lines.

According to @truemedian on luvit's Discord server, this is caused by this code, as it resets it to the left edge but never goes up.

Pic of the issue:
ChLjvpHn4f


luvit version: 2.17.0

This is something I've been meaning to fix for a long time. How do other repls handle this? Do they allow the line to wrap and handle the wrapping, or do they truncate the line so that it never wraps?

P.S. you got the markdown formatting on your code link reversed

NodeJS handles this by calculating what line the buffer is on here which gets used in readline's refreshLine set here and is used here

P.S. you got the markdown formatting on your code link reversed

oops... i know how to write markdown, don't I :)