fix out of range error for linux platform

This commit is contained in:
sqshq 2019-04-13 19:23:44 -04:00
parent ca6a328682
commit c8ba8e9491
1 changed files with 5 additions and 1 deletions

View File

@ -90,7 +90,11 @@ func (s *SparkLine) Draw(buffer *ui.Buffer) {
height := s.Dy() - 2
minValue := util.FormatValue(s.minValue, s.scale)
maxValue := util.FormatValue(s.maxValue, s.scale)
curValue := util.FormatValue(s.values[len(s.values)-1], s.scale)
curValue := util.FormatValue(0, s.scale)
if len(s.values) > 0 {
curValue = util.FormatValue(s.values[len(s.values)-1], s.scale)
}
indent := 2 + util.Max([]int{
len(minValue), len(maxValue), len(curValue),