Skip to content

Conversation

KiGamji
Copy link

@KiGamji KiGamji commented Sep 7, 2025

Type of changes

  • Bug fix
  • Tests

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Previously, rstrip_end and truncate were being called even when soft wrapping was enabled, which led to visual bugs where trailing spaces and their backgrounds were incorrectly trimmed.

This change ensures that line trimming logic is now correctly applied only during hard wrapping.

This also updates the expected output in a Syntax test that was dependent on the old buggy behavior.

Fixes #3841

Previously, `rstrip_end` and `truncate` were being called even when
soft wrapping was enabled, which led to visual bugs where trailing
spaces and their backgrounds were incorrectly trimmed.

This change ensures that line trimming logic is now correctly
applied only during hard wrapping.

This also updates the expected output in a `Syntax` test that was
dependent on the old buggy behavior.

Fixes Textualize#3841
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Trailing background color is trimmed when soft wrapping is enabled
1 participant