1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

support reverting merge commits

This commit is contained in:
Jesse Duffield
2021-06-05 16:39:59 +10:00
parent f91adf026b
commit fb395bca6e
46 changed files with 198 additions and 10 deletions

View File

@ -87,6 +87,14 @@ func TruncateWithEllipsis(str string, limit int) string {
return str[0:remainingLength] + "..."
}
func SafeTruncate(str string, limit int) string {
if len(str) > limit {
return str[0:limit]
} else {
return str
}
}
func FindStringSubmatch(str string, regexpStr string) (bool, []string) {
re := regexp.MustCompile(regexpStr)
match := re.FindStringSubmatch(str)