1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

vastly improve the logic for undo and redo

This commit is contained in:
Jesse Duffield
2020-03-24 21:57:53 +11:00
parent 32d3e497c3
commit d105e2690a
3 changed files with 128 additions and 91 deletions

View File

@ -316,3 +316,9 @@ func TruncateWithEllipsis(str string, limit int) string {
remainingLength := limit - len(ellipsis)
return str[0:remainingLength] + "..."
}
func FindStringSubmatch(str string, regexpStr string) (bool, []string) {
re := regexp.MustCompile(regexpStr)
match := re.FindStringSubmatch(str)
return len(match) > 0, match
}