[#159] fix slice bounds out of range error in abbrev template function

This commit is contained in:
Cory Bennett
2018-04-01 11:47:23 -07:00
parent 79c83f6911
commit 359bec2fdf
+1 -1
View File
@@ -158,7 +158,7 @@ func TemplateProcessor() *template.Template {
return strings.Join(vals, sep)
},
"abbrev": func(max int, content string) string {
if len(content) > max {
if len(content) > max && max > 2 {
var buffer bytes.Buffer
buffer.WriteString(content[:max-3])
buffer.WriteString("...")