peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.04k stars 132 forks source link

Extra new line on long lines #26

Closed ElPincheTopo closed 9 years ago

ElPincheTopo commented 9 years ago

Maybe this is the default behavior but I'm not sure because I have never seen it before in other programs. When you have a really long line, that is longer than your terminal window, instead of doing word wrap it just scrolls on the same line using { and } to signal that some text is missing in some direction.

That works great, but the moment when you go from having a line of the width of your terminal to having a line one char longer, a new line is inserted and the prompt gets redrawned with the { and then the scrolled part of the line. if you then press backspace then again it prints a new line followed by the previous line (the one without the { and } for indicating scrolling).

Maybe it's just me but if it isn't a bug, I think that the whole print in a new line is unnecessary. I'm testing it on Windows 8.1.

peterh commented 9 years ago

Yes, that's a bug. Thanks for the bug report. I'll try to make time to fix it soon.