Including language-diff package as core


#1

Considering how Git-savvy Atom is, maybe it would be cool for a language-diff package to be included as a core package, this would mark up and color diffs like this:

diff --git a/app/styles/_base.scss b/app/styles/_base.scss
index ba837f9..84b5401 100644
--- a/app/styles/_base.scss
+++ b/app/styles/_base.scss
@@ -110,3 +110,7 @@ img, svg, iframe, canvas {
 input {
   line-height: inherit;
 }
+
+label {
+  cursor: pointer;
+}

There already is a converted TextMate package, language-diff. I was looking in the styleguide and in the core themes for clues for classes Atom could be expecting, but I only found that it styles meta.diff and meta.diff.header, not the added/removed lines themselves.

I was trying to “fix” language-diff’s coloring, but I think themes are lacking support for it?


#2

There are a couple of git packages out there, and I believe one of them provided that for me.

Automatigit?
Git-Control?
Git History?
Git Plus?

I’ve also got Git Diff installed…

Bottom line: I think for diff syntax highlighting, “language-diff” is the wrong one at the moment.


#3

Git Plus and Automatigit both provide it. But none of them have green and red coloring for removed and added lines :cry:

I think the most appropriate place for diff grammar is Git Diff then, since it’s a core package.


#4

The language-diff package is the right place for what you’re talking about, syntax highlighting of diff files. The Git Diff package is for showing diff information in the gutter.

If your theme doesn’t color things that you want colored, or colors them incorrectly in your opinion, you can always add syntax coloring rules to your styles.less. This is one of the awesome things about Atom, you have complete control over your environment.

And since you have complete control over your environment, there’s really no functional difference between a core package and a non-core package. If you want something to be in core, you should be talking less about why you want it and more about:

  1. Why I should have to install something I don’t want or won’t use (other than to make images to illustrate points)
  2. Why the Atom Core team should have to take over support of it

Because that’s really what you’re saying, it should be in core because it is important enough that everyone should have it installed.


#5

Yes, I can always add custom styles, I just thought it would be a good idea for Atom to provide that styling out-of-the-box, because it’s such a common “language”. But you’re right, it makes virtually no difference if it’s a core package or not.

Let me rephrase the question: What can I do to provide default diff styling for most people, so they don’t have to do it themselves?

Is forking themes a good idea? Because the color choice should vary depending on the theme.


#6

Yes, you could add support for this to various themes. I’d suggest submitting pull requests rather than just forking.


#7

That’s what I meant :smile: