Skip to content

Commit 6d19084

Browse files
committed
update for feedback, fix off-by-one when used with -l
1 parent abc06c7 commit 6d19084

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/poetry/console/commands/show.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def handle(self) -> int | None:
267267
required_by = reverse_deps(locked, locked_repo)
268268
required_by_length = max(
269269
required_by_length,
270-
len("via " + ",".join(required_by.keys())),
270+
len(" from " + ",".join(required_by.keys())),
271271
)
272272
else:
273273
name_length = max(name_length, current_length)
@@ -288,14 +288,12 @@ def handle(self) -> int | None:
288288

289289
write_version = name_length + version_length + 3 <= width
290290
write_latest = name_length + version_length + latest_length + 3 <= width
291-
write_why = self.option("why") and (
292-
name_length + version_length + latest_length + required_by_length + 3
293-
<= width
294-
)
295-
write_description = (
296-
name_length + version_length + latest_length + required_by_length + 24
297-
<= width
291+
292+
why_end_column = (
293+
name_length + version_length + latest_length + required_by_length
298294
)
295+
write_why = self.option("why") and (why_end_column + 3) <= width
296+
write_description = (why_end_column + 24) <= width
299297

300298
for locked in locked_packages:
301299
color = "cyan"

0 commit comments

Comments
 (0)