Disable line wrapping during rendering

Prevent unwanted line wraps that break the layout when the actual
display width of a character is different than expected.
This commit is contained in:
Junegunn Choi 2024-04-09 00:26:25 +09:00
parent 69b9d674a3
commit 4cd37fc02b
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -71,7 +71,7 @@ func (r *LightRenderer) csi(code string) string {
func (r *LightRenderer) flush() {
if r.queued.Len() > 0 {
fmt.Fprint(os.Stderr, "\x1b[?25l"+r.queued.String()+"\x1b[?25h")
fmt.Fprint(os.Stderr, "\x1b[?7l\x1b[?25l"+r.queued.String()+"\x1b[?25h\x1b[?7h")
r.queued.Reset()
}
}