Giter Club home page Giter Club logo

language-diff's Introduction

language-diff's People

Contributors

alhadis avatar florianfranzen avatar fossabot avatar hironytic avatar miketheman avatar silvenon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

language-diff's Issues

Update theme to hilight whole lines

I thought it would be great to hilight the whole diffed lines, so I ended using the following stylesheet:

atom-text-editor::shadow {
  .line {
    position: relative;

    .meta.diff.header::after, .meta.diff.index::after,
    .markup.inserted.diff::after, .markup.deleted.diff::after {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: block;
      z-index: -100;
      content: '';
    }

    .meta.diff.header::after, .meta.diff.index::after {
      background-color: #113050;
    }

    .markup.inserted.diff::after {
      background-color: #224422;
    }

    .markup.deleted.diff::after {
      background-color: #442222;
    }

    .markup.inserted.diff {
      color: #ccffcc;
    }

    .markup.deleted.diff {
      color: #ddaaaa;
    }
  }
}

It renders well with my theme (solarized-dark), but colors might need to be changed to use theme colors.

Here is a preview:

capture d ecran 2017-08-09 a 11 05 22

I got the CSS from here : https://discuss.atom.io/t/highlight-entire-line-depending-on-syntax/20653

Feature Request: Better support for recursive diffs

If you do a recursive diff to compare two directories, the output includes lines like:

Only in DIR_NAME: FILENAME

It would be great if the syntax could be modified to emphasize these lines in some way. Without emphasis, it's easy to overlook them, because the colored lines stand out much more. Perhaps bolding them would work well?

Deprecated selector in `language-diff\styles\diff.less`

In language-diff\styles\diff.less:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor::shadow .diff.inserted => atom-text-editor.editor .syntax--diff.syntax--inserted

  • atom-text-editor::shadow .diff.changed => atom-text-editor.editor .syntax--diff.syntax--changed

  • atom-text-editor::shadow .diff.deleted => atom-text-editor.editor .syntax--diff.syntax--deleted

  • atom-text-editor::shadow .diff.only-in => atom-text-editor.editor .syntax--diff.syntax--only-in

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

Changes required due to TextBuffer.save becoming async in Atom 1.19

Hi! Thanks for maintaining the language-diff package!

In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise that resolves when the save is complete. Because of this, a few other Atom APIs that use save have similarly become async:

  • Pane.close
  • TextBuffer.save
  • TextEditor.save
  • Pane.saveItem
  • Pane.saveItemAs
  • Pane.saveActiveItem
  • Pane.saveActiveItemAs
  • Pane.saveItems
  • Workspace.saveActivePaneItem
  • Workspace.saveActivePaneItemAs

Effects on this package

We think this package could be impacted by this upgrade because it calls the changed methods in the following places:

  • TextEditor.save

We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.

What to do about the change

It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:

Please let me know if you have any questions. I would be happy to help!

Support for word diffs

If you view a diff produced using git diff --word-diff=plain, it doesn't get highlighted.

Deprecated selector in `language-diff/styles/diff.less`

In language-diff/styles/diff.less:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor::shadow .diff.inserted => atom-text-editor.editor .syntax--diff.syntax--inserted

  • atom-text-editor::shadow .diff.changed => atom-text-editor.editor .syntax--diff.syntax--changed

  • atom-text-editor::shadow .diff.deleted => atom-text-editor.editor .syntax--diff.syntax--deleted

  • atom-text-editor::shadow .diff.only-in => atom-text-editor.editor .syntax--diff.syntax--only-in

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

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.