expand tab characters to spaces

This commit is contained in:
Gokcehan 2020-07-04 01:08:35 +03:00
parent 83a6e506d2
commit 1119ba0d25

6
ui.go
View File

@ -153,7 +153,11 @@ func (win *win) print(x, y int, fg, bg termbox.Attribute, s string) (termbox.Att
i += w - 1
if r == '\t' {
x += gOpts.tabstop - (x-off)%gOpts.tabstop
s := gOpts.tabstop - (x-off)%gOpts.tabstop
for i := 0; i < s && x+i < win.w; i++ {
termbox.SetCell(win.x+x+i, win.y+y, ' ', fg, bg)
}
x += s
} else {
x += runewidth.RuneWidth(r)
}