gizak / termui

Golang terminal dashboard
MIT License
13.16k stars 787 forks source link

widgets.Tree graphical error #242

Open ghost opened 5 years ago

ghost commented 5 years ago

I haven't had time to test this thoroughly, might come back later to see if this affects other widgets etc.

Code:

type stringer string
func (s stringer) String() string {
  return string(s)
}
node := widgets.TreeNode{Value: stringer{"[1098]"}}
someTree.SetNodes([]*widgets.TreeNode{&node})

Expected: Tree will display as [1098] Actual: Tree displays as [1098

If the string ends with a trailing space or other character, the whole string is displayed as expected. (e.g. [1098]], [1098] etc.)

Screenshot from 2019-08-22 16-11-35