summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-03-28 22:11:56 +0800
committerGitHub <noreply@github.com>2024-03-28 22:11:56 +0800
commit2206593612619d1fe5a7de48512e9601fc466108 (patch)
treeb5d6421fb9cf4c031d10b51cd4b251df6bfe42a3 /src/render
parent68a1d98a3dd583c506447e8035f07ea05408f4dd (diff)
downloadaichat-2206593612619d1fe5a7de48512e9601fc466108.tar.gz
fix: incorrectly render text contains tabs (#384)
Diffstat (limited to 'src/render')
-rw-r--r--src/render/stream.rs5
1 files changed, 4 insertions, 1 deletions
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