mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #335] Weird bug with dynamic colors and word wrap true property #254
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#254
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Bios-Marcel on GitHub (Aug 20, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/335
Hey,
When I have a
TextViewthat has bothDynamicColorsandWordWrapontrueand I use this code:It will not apply the colors correctly.
However, if you now add another character behind the space, an
Ffor example, it will behave correct.@rivo commented on GitHub (Oct 17, 2019):
Yes, this is because you set word-wrap to
true. This will remove trailing spaces. When we word-wrap, trailing spaces in a line should not take up extra space. The last character of a word on a line should not be a space character. So we remove them.If you call
SetWordWrap(false), your example will show the coloured space character.@Bios-Marcel commented on GitHub (Oct 17, 2019):
Hm, I see. That's a shame, since I intended using a space with changed background color as a fake cursor in oder to implement an editor.
@rivo commented on GitHub (Dec 29, 2019):
I understand. Maybe you can use some kind of almost-empty character instead.