Skip to content

Commit 544f497

Browse files
Move buffer change inside if
1 parent 3ade678 commit 544f497

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/pdb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,11 @@ def gen_colors(self, buffer):
477477
Span(leading_spaces, leading_spaces + len(leading_text) - 1),
478478
"soft_keyword"
479479
)
480+
# Redact the command text with spaces so there will be no duplicated
481+
# color span generated for it later.
480482
redact_length = leading_spaces + len(leading_text)
481-
else:
482-
redact_length = 0
483+
buffer = ' ' * redact_length + buffer[redact_length:]
483484

484-
buffer = ' ' * redact_length + buffer[redact_length:]
485485
yield from _pyrepl.utils.gen_colors(buffer)
486486

487487

0 commit comments

Comments
 (0)