Comments (7)
But, I'm not currently considering it a bug: delta's behavior is the same as Github/GitLab [...]
@dandavison Hm, that's not entirely true though? Note my subsequent clarification of GitHub/GitLab behavior in #13 (comment):
- non-emph color: this line has been changed
- emph color: here's a bit of extra help in understanding the change (only if there are no whole-line deletions or insertions in this hunk)
Corollary: If there are emph highlights in a hunk, then all non-emph parts of that hunk are not new.
@fdcds's example shows how delta differs from that behavior: there are emph highlights (the additions on the existing lines), but some of the non-emph highlights are also new (the new lines).
So looking at that example, my brain thinks: okay cool, there are emph highlights, and "a" itself is non-emph so it's not new, then since "x" is also non-emph it's also not new--ahh but it's an entirely new line, so it is new after all.
from delta.
Thanks. OK, so this is what I get on MacOS. Are my file contents the same as yours and could you post your OS and a screenshot of your delta output if it remains unclear what is going on?
/tmp bat -A a
───────┬──────────────────────────────────────────────────────────────────────
│ File: a
───────┼──────────────────────────────────────────────────────────────────────
1 │ a␊
2 │ b␊
3 │ c␊
───────┴──────────────────────────────────────────────────────────────────────
/tmp bat -A b
───────┬──────────────────────────────────────────────────────────────────────
│ File: b
───────┼──────────────────────────────────────────────────────────────────────
1 │ x␊
2 │ ••a␊
3 │ ••b␊
4 │ ••c␊
5 │ y␊
───────┴──────────────────────────────────────────────────────────────────────
from delta.
Thanks. OK, so this is what I get on MacOS. Are my file contents the same as yours and could you post your OS and a screenshot of your delta output if it remains unclear what is going on?
That is how it looks like here, too. I assume it will be fixed by #13.
from delta.
Yes, in #13 we're thinking of adding an option to change the emph/non-emph color assignments. But, I'm not currently considering it a bug: delta's behavior is the same as Github/GitLab -- if a line is completely new and not derived from a previous line, it gets light green (plus_color
), not dark green (plus_emph_color
). See #13 (comment) where we tentatively interpreted the meaning of Github's colors as follows:
- non-emph color: this line has been changed
- emph color: here's a bit of extra help in understanding the change
Does this interpretation agree with how you're thinking about it?
from delta.
I think I can get used to this, if I change the colour scheme to make plus_color
more visible on a dark slightly translucent background.
from delta.
Thanks for the discussion here! It's a slightly tricky/detailed issue but I would like to address it, at least with an option.
At a high level, one thing that bothers me is I had been thinking of the "pale green" color as the "default" for new content (probably because I'm used to Github). So, say a user adds an entirely new file. I'm hesitant to make it all "dark green" -- that would be kind of a big change in appearance which might bother people who had got used to / liked the existing colors / set up custom color.
from delta.
So, say a user adds an entirely new file. I'm hesitant to make it all "dark green" [...]
Yep, it shouldn't be dark! That falls into the condition, "only if there are no whole-line deletions or insertions in this hunk," and indeed GitHub highlights new files all light green, as it would any entirely new hunk.
from delta.
Related Issues (20)
- 🐛 delta won't show diffs of files marked as autogenerated with `.gitattributes` even though they're text files HOT 3
- 🚀 Release filename without version HOT 1
- 🐛 Mouse scroll not working HOT 1
- Show filename when using `git blame -CCC` 🚀
- Commit hyperlink not working 🐛
- 🐛 git-grep path output is often replacing "/" with ":" HOT 1
- RUSTSEC-2023-0081: safemem is unmaintained
- 🐛 Delta doesn't highlight matches if `color.grep.match` changed
- Remove empty lines around filename 🚀
- 🐛 Possible race condition in delta testsuite with environment variable setting
- 🚀 Consider making README.md mention that color settings in .gitconfig can override delta's colors
- 🐛 Docu: Build instructions incomplete
- 🐛 Docu: Link to repo?
- 🐛 Delta on Windows doesn't use .gitconfig file HOT 1
- allow to completely omit zero ("same") lines (like `diff -U0` would do) HOT 6
- 🐛 Delta sometimes duplicates diff entries HOT 1
- 🐛 Colours different on different systems. HOT 1
- 🐛 Delta as `diffFilter` breaks keyboard input with `git add -p` in Git CMD HOT 12
- 🐛 delta fails to build with enabled `lto` HOT 1
- 🐛 Incorrect use of bright-black background with native less pager on Windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delta.