From 2206593612619d1fe5a7de48512e9601fc466108 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 28 Mar 2024 22:11:56 +0800 Subject: fix: incorrectly render text contains tabs (#384) --- src/render/stream.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/render/stream.rs b/src/render/stream.rs index 2c05119..ee38759 100644 --- a/src/render/stream.rs +++ b/src/render/stream.rs @@ -77,7 +77,10 @@ fn markdown_stream_inner( spinner.stop(writer)?; match reply_event { - ReplyEvent::Text(text) => { + ReplyEvent::Text(mut text) => { + // tab width hacking + text = text.replace('\t', " "); + let (col, mut row) = cursor::position()?; // Fix unexpected duplicate lines on kitty, see https://github.com/sigoden/aichat/issues/105 -- cgit v1.2.3