Improve drawing

This commit is contained in:
Zachary Yedidia 2017-02-19 10:16:02 -05:00
parent b669437296
commit 0adb601f3c
2 changed files with 2 additions and 5 deletions

View file

@ -103,12 +103,9 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
nextLine := line[colN:]
lineLength := min(StringWidth(string(nextLine), tabsize), width)
if len(c.lines[viewLine]) != lineLength {
c.lines[viewLine] = make([]*Char, lineLength)
}
c.lines = append(c.lines, make([]*Char, lineLength))
viewCol = 0
}
}

View file

@ -42,7 +42,7 @@ func (v *View) DisplayView() {
left := v.leftCol
top := v.Topline
v.cellview.Draw(v.Buf, top, height, left, width)
v.cellview.Draw(v.Buf, top, height, left, width-v.lineNumOffset)
screenX := v.x
realLineN := top - 1