mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
git: add option for difftastic context
The ability to control the number of contextual lines is a basic expectation of a diff program, so a dedicated option feels warranted.
This commit is contained in:
parent
d328666dba
commit
1652349e57
3 changed files with 13 additions and 2 deletions
|
|
@ -356,6 +356,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
context = mkOption {
|
||||
type = types.ints.u32;
|
||||
default = 3;
|
||||
example = 5;
|
||||
description = ''
|
||||
Determines the number of contextual lines to show around changed lines.
|
||||
'';
|
||||
};
|
||||
|
||||
display = mkOption {
|
||||
type = types.enum [
|
||||
"side-by-side"
|
||||
|
|
@ -833,6 +842,7 @@ in
|
|||
"--color ${cfg.difftastic.color}"
|
||||
"--background ${cfg.difftastic.background}"
|
||||
"--display ${cfg.difftastic.display}"
|
||||
"--context ${toString cfg.difftastic.context}"
|
||||
];
|
||||
in
|
||||
(lib.mkMerge [
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
[diff]
|
||||
external = "@difftastic@/bin/difft --color always --background dark --display inline"
|
||||
external = "@difftastic@/bin/difft --color always --background dark --display inline --context 5"
|
||||
tool = "difftastic"
|
||||
|
||||
[difftool "difftastic"]
|
||||
cmd = "@difftastic@/bin/difft --color always --background dark --display inline $LOCAL $REMOTE"
|
||||
cmd = "@difftastic@/bin/difft --color always --background dark --display inline --context 5 $LOCAL $REMOTE"
|
||||
|
||||
[gpg]
|
||||
format = "openpgp"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
enableAsDifftool = true;
|
||||
background = "dark";
|
||||
color = "always";
|
||||
context = 5;
|
||||
display = "inline";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue