diff options
author | mjarkk <mkopenga@gmail.com> | 2021-07-22 12:02:41 +0200 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2021-07-22 22:12:43 +0200 |
commit | 9a087d04ebaed311e0bd3d9cbd32dd2973f0406c (patch) | |
tree | 7e0fd92807348112b9ac850424d4469711322af3 /pkg/gui/presentation | |
parent | 1573a449f84846657b7ac9e07756caa9db548b0e (diff) |
Change the way file statuses are loaded
This makes it so file statuses recived from git no longer get joined
before spliting them again.
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r-- | pkg/gui/presentation/files.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/gui/presentation/files.go b/pkg/gui/presentation/files.go index 96fdbaa1f..f45ef04d3 100644 --- a/pkg/gui/presentation/files.go +++ b/pkg/gui/presentation/files.go @@ -1,6 +1,8 @@ package presentation import ( + "strings" + "github.com/fatih/color" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/theme" @@ -48,6 +50,14 @@ func GetFileLine(hasUnstagedChanges bool, hasStagedChanges bool, name string, di output += restColor.Sprint(" ") } + name = strings.NewReplacer( + "\n", "\\n", + "\r", "\\r", + "\t", "\\t", + "\b", "\\b", + "\f", "\\f", + "\v", "\\v", + ).Replace(name) output += restColor.Sprint(name) if file != nil && file.IsSubmodule(submoduleConfigs) { |