mirror of https://github.com/bcicen/ctop.git
Use runewidth to increment x in TextView
This commit is contained in:
parent
0094cba5ea
commit
78b038e687
|
@ -2,6 +2,7 @@ package widgets
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ui "github.com/gizak/termui"
|
ui "github.com/gizak/termui"
|
||||||
|
"github.com/mattn/go-runewidth"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ToggleText interface {
|
type ToggleText interface {
|
||||||
|
@ -70,7 +71,7 @@ func (t *TextView) Buffer() ui.Buffer {
|
||||||
for _, ch := range line {
|
for _, ch := range line {
|
||||||
cell = ui.Cell{Ch: ch, Fg: t.TextFgColor, Bg: t.TextBgColor}
|
cell = ui.Cell{Ch: ch, Fg: t.TextFgColor, Bg: t.TextBgColor}
|
||||||
buf.Set(x, y, cell)
|
buf.Set(x, y, cell)
|
||||||
x++
|
x = x + runewidth.RuneWidth(ch)
|
||||||
}
|
}
|
||||||
x = t.Block.X + t.padding[0]
|
x = t.Block.X + t.padding[0]
|
||||||
y++
|
y++
|
||||||
|
|
Loading…
Reference in New Issue