diff options
author | DerTeta <derteta@gmx.de> | 2021-08-21 21:14:35 +0200 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-12-06 22:37:28 +1100 |
commit | 14d9e776be401ffc6d27cf4ef9f21a41cd203f41 (patch) | |
tree | bd0d1fc5edd788699b3b12187caea66b8f1a4a8e /pkg/commands/files.go | |
parent | ca88620e8fd68df4cec86007679665ccdda5c0e7 (diff) |
Use `DiffContextSize` in `ShowFileDiffStr`
Diffstat (limited to 'pkg/commands/files.go')
-rw-r--r-- | pkg/commands/files.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/commands/files.go b/pkg/commands/files.go index bf692595a..8eb154c30 100644 --- a/pkg/commands/files.go +++ b/pkg/commands/files.go @@ -248,6 +248,7 @@ func (c *GitCommand) ShowFileDiff(from string, to string, reverse bool, fileName func (c *GitCommand) ShowFileDiffCmdStr(from string, to string, reverse bool, fileName string, plain bool) string { colorArg := c.colorArg() + contextSize := c.Config.GetUserConfig().Git.DiffContextSize if plain { colorArg = "never" } @@ -257,7 +258,7 @@ func (c *GitCommand) ShowFileDiffCmdStr(from string, to string, reverse bool, fi reverseFlag = " -R " } - return fmt.Sprintf("git diff --submodule --no-ext-diff --no-renames --color=%s %s %s %s -- %s", colorArg, from, to, reverseFlag, c.OSCommand.Quote(fileName)) + return fmt.Sprintf("git diff --submodule --no-ext-diff --unified=%d --no-renames --color=%s %s %s %s -- %s", contextSize, colorArg, from, to, reverseFlag, c.OSCommand.Quote(fileName)) } // CheckoutFile checks out the file for the given commit |