[GH-ISSUE #241] Textattributes in tablecell aren't applied to the first rune #186

Closed
opened 2026-03-04 01:02:44 +03:00 by kerem · 1 comment
Owner

Originally created by @Bios-Marcel on GitHub (Feb 23, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/241

When using color and attribute tags in a tablecell, the color applies to the complete string, but the text attributes only apply to everything after the first rune.

Image of the bug occuring

Reproduce using this code:

package main

import "github.com/rivo/tview"

func main() {
	table := tview.NewTable()
	table.SetCellSimple(0, 0, "[blue][::ub]Hello World")
	textView := tview.NewTextView().SetText("[blue][::ub]Hello World").SetDynamicColors(true)

	layout := tview.NewFlex()
	layout.AddItem(table, 0, 1, false)
	layout.AddItem(textView, 0, 1, false)

	tview.NewApplication().SetRoot(layout, true).Run()
}
Originally created by @Bios-Marcel on GitHub (Feb 23, 2019). Original GitHub issue: https://github.com/rivo/tview/issues/241 When using color and attribute tags in a tablecell, the color applies to the complete string, but the text attributes only apply to everything after the first rune. ![Image of the bug occuring](https://i.imgur.com/KrYqmCc.png) Reproduce using this code: ```go package main import "github.com/rivo/tview" func main() { table := tview.NewTable() table.SetCellSimple(0, 0, "[blue][::ub]Hello World") textView := tview.NewTextView().SetText("[blue][::ub]Hello World").SetDynamicColors(true) layout := tview.NewFlex() layout.AddItem(table, 0, 1, false) layout.AddItem(textView, 0, 1, false) tview.NewApplication().SetRoot(layout, true).Run() } ```
kerem closed this issue 2026-03-04 01:02:44 +03:00
Author
Owner

@rivo commented on GitHub (Mar 9, 2019):

Thanks for catching this. The latest commit should fix this.

<!-- gh-comment-id:471169463 --> @rivo commented on GitHub (Mar 9, 2019): Thanks for catching this. The latest commit should fix this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#186
No description provided.