Giter Site home page Giter Site logo

Comments (7)

nkouevda avatar nkouevda commented on May 5, 2024 1

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.

dandavison avatar dandavison commented on May 5, 2024

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␊
───────┴──────────────────────────────────────────────────────────────────────

image

from delta.

fdcds avatar fdcds commented on May 5, 2024

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?

image

That is how it looks like here, too. I assume it will be fixed by #13.

from delta.

dandavison avatar dandavison commented on May 5, 2024

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.

fdcds avatar fdcds commented on May 5, 2024

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.

dandavison avatar dandavison commented on May 5, 2024

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.

nkouevda avatar nkouevda commented on May 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.