Fix overlap in folded strings

pull/143/head
micnncim 6 years ago
parent 6208c6e91f
commit 134b6baf4d
  1. 8
      pkg/searchapp/item.go

@ -241,23 +241,23 @@ func (ic ItemColumns) ProduceLine(dateLength int, locationLength int, flagLength
}
func leftCutPadString(str string, newLen int) string {
dots := "…"
dots := "… "
strLen := len(str)
if newLen > strLen {
return strings.Repeat(" ", newLen-strLen) + str
} else if newLen < strLen {
return dots + str[strLen-newLen+1:]
return dots + str[strLen-newLen+2:]
}
return str
}
func rightCutPadString(str string, newLen int) string {
dots := "…"
dots := " …"
strLen := len(str)
if newLen > strLen {
return str + strings.Repeat(" ", newLen-strLen)
} else if newLen < strLen {
return str[:newLen-1] + dots
return str[:newLen-2] + dots
}
return str
}

Loading…
Cancel
Save