mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #420] Feature request: turn off a specific attribute using color tags #309
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#309
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 @gnojus on GitHub (Mar 26, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/420
Currently, the only way one can reset all text attributes with a color is using
[::-]. This therefore makes it hard to print text likenormal
underlined bold underlined underlinednormal(instead of strikethrough should be underlined)
as all the attributes are removed. Maybe a
!bcould turn off bold only, or if you want to keep single character tags the letter case could determine the difference.The above example could be accomplished by something like this:
normal [::u]underlined [::b]bold underlined[::!b] underlined[::!u] normalor
normal [::u]underlined [::b]bold underlined[::B] underlined[::U] normalLet me know how this sounds, I can open a PR if this would be suitable for tview.
@rivo commented on GitHub (Apr 14, 2020):
I think this makes sense. I will look into this myself. No need to submit a PR.
@gnojus commented on GitHub (Jul 5, 2020):
I realized that I had a wrong view of these attribute tags. I wrongly assumed that they would stack continuously, that is something like
[::b]A[::u]Bwould result inAbeing bold andBbeing both bold and underlined. But actuallyAwould only be bold andB- only underlined.This means that you cannot add a single attribute to the current mask and therefore it wouldn't probably make too much sense to have the ability to disable a single one as well.
@rivo commented on GitHub (Nov 9, 2021):
@nojus297 Coming back to this due to #619, your last message here makes it sound like your request wasn't so much about turning off individual attributes but stacking styles. In that case, I'd rather refer to #619 and close this issue.
@gnojus commented on GitHub (Nov 9, 2021):
Sounds good to me
@rivo commented on GitHub (Aug 26, 2023):
Btw, attributes can now also be turned off individually.