mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-06-20 01:19:23 +02:00
correctly show files with special chars in commit
This commit is contained in:
@@ -32,3 +32,15 @@ func NormalizeLinefeeds(str string) string {
|
||||
str = strings.Replace(str, "\r", "", -1)
|
||||
return str
|
||||
}
|
||||
|
||||
// EscapeSpecialChars - Replaces all special chars like \n with \\n
|
||||
func EscapeSpecialChars(str string) string {
|
||||
return strings.NewReplacer(
|
||||
"\n", "\\n",
|
||||
"\r", "\\r",
|
||||
"\t", "\\t",
|
||||
"\b", "\\b",
|
||||
"\f", "\\f",
|
||||
"\v", "\\v",
|
||||
).Replace(str)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user