Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from diff-so-fancy to delta #282

Merged

Conversation

arcticicestudio
Copy link
Owner

Closes #281

diff-so-fancy [1] provided a way better highlighting than
diff-highlight [2], the tool that is shipped with Git.
Anyway, next to the fact that it is written in Perl and required yet
another interpreter installation, there have also been long-time
problems regarding the `fatal: mismatched output` error when running as
`interactive.diffFilter`.
In so-fancy/diff-so-fancy#296 and
so-fancy/diff-so-fancy#35 are long discussions
and some proposed workarounds, but none really worked properly.

Therefore I switched to delta [3] a while ago and the configurations
have now been tested enough on a day-by-day basis to be persisted in
igloo.
delta not only provides the same features like diff-so-fancy and other
highlighters [4] but comes with many more advantages. The highlighting
can also be styled using the same themes like bat [5] that is also
already available as snowblock [6].

The colors have been adjusted to match the Nord [7] theme.
Note that the Nord color palettes must be provided through the
terminal [8] as the 16 ANSI base colors. Some diff specific colors
have been specified as HEX tripplets. The background colors for added,
removed and modified lines are adjusted in brightness and saturation
using the `scale()` function [9] of the `color` module [10] provided by
the official Sass reference implementation written in Dart [11].

```scss
@use "sass:color";

$nord10: #5e81ac;
$nord11: #bf616a;

$minus-color: color.scale($nord11, $lightness: -28%, $saturation: -20%);
$plus-color: color.scale($nord10, $lightness: -22%, $saturation: -16%);
```

[1]: https://github.com/so-fancy/diff-so-fancy
[2]: https://github.com/git/git/tree/master/contrib/diff-highlight
[3]: https://github.com/dandavison/delta
[4]: https://github.com/dandavison/delta#features
[5]: https://github.com/sharkdp/bat
[6]: https://github.com/arcticicestudio/igloo/tree/master/snowblocks/bat
[7]: https://www.nordtheme.com
[8]: https://www.nordtheme.com/ports
[9]: https://sass-lang.com/documentation/modules/color#scale
[10]: https://sass-lang.com/documentation/modules
[11]: https://github.com/sass/dart-sass

GH-281

Co-authored-by: Sven Greb <[email protected]>
@arcticicestudio arcticicestudio merged commit 4815419 into master May 9, 2020
@arcticicestudio arcticicestudio deleted the feature/gh-281-switch-diff-so-fancy-to-delta branch May 9, 2020 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch from diff-so-fancy to delta
2 participants