expand tab characters to spaces
This commit is contained in:
parent
83a6e506d2
commit
1119ba0d25
6
ui.go
6
ui.go
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user