Fix crash if tabs extend past view width

Ref #631
This commit is contained in:
Zachary Yedidia
2017-04-21 12:48:03 -04:00
parent 591e5e3145
commit 471a8b7c2b

View File

@@ -146,7 +146,7 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
for i := 1; i < width; i++ {
viewCol++
if viewCol >= 0 {
if viewCol >= 0 && viewCol < width {
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, ' ', curStyle, 1}
}
}
@@ -158,7 +158,7 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
}
for i := 1; i < width; i++ {
viewCol++
if viewCol >= 0 {
if viewCol >= 0 && viewCol < width {
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, ' ', curStyle, 1}
}
}