Align AI text indent with user and add bold to colored chat text
This commit is contained in:
parent
475e900e18
commit
7777dea0cc
@ -115,7 +115,7 @@ def draw_chat(app, stdscr):
|
|||||||
elif role == "ai":
|
elif role == "ai":
|
||||||
label = f" Hendrik ({item['time']}) "
|
label = f" Hendrik ({item['time']}) "
|
||||||
rendered.append((C_AI, label))
|
rendered.append((C_AI, label))
|
||||||
_wrap_render(text, indent=3, color=C_INPUT)
|
_wrap_render(text, indent=1, color=C_INPUT)
|
||||||
elif role == "system":
|
elif role == "system":
|
||||||
lines = text.split("\n")
|
lines = text.split("\n")
|
||||||
rendered.append((C_SYSTEM, lines[0]))
|
rendered.append((C_SYSTEM, lines[0]))
|
||||||
@ -146,7 +146,7 @@ def draw_chat(app, stdscr):
|
|||||||
y = chat_top
|
y = chat_top
|
||||||
for i in range(app.scroll, min(app.scroll + chat_h, total)):
|
for i in range(app.scroll, min(app.scroll + chat_h, total)):
|
||||||
color, text = rendered[i]
|
color, text = rendered[i]
|
||||||
attr = curses.color_pair(color) if color else curses.A_NORMAL
|
attr = curses.color_pair(color) | curses.A_BOLD if color else curses.A_NORMAL
|
||||||
if len(text) >= w:
|
if len(text) >= w:
|
||||||
text = text[: w - 1]
|
text = text[: w - 1]
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user