Skip to content

Commit

Permalink
Magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofdusk committed Oct 28, 2023
1 parent ff7d0ac commit 5a69215
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gptcmd/cli.py
Original file line number Diff line number Diff line change
@@ -83,7 +83,8 @@ def _fragment(tpl: str, msg: Message) -> str:
are replaced with the message fragment.
"""
PLACEHOLDER = "..."
width = 79 - len(tpl.format(msg=""))
MAX_LENGTH = 79
width = MAX_LENGTH - len(tpl.format(msg=""))
content = msg.content
res = shorten(content, width=width, placeholder=PLACEHOLDER)
if res == PLACEHOLDER:

0 comments on commit 5a69215

Please sign in to comment.