Giter Club home page Giter Club logo

Comments (4)

danvk avatar danvk commented on July 30, 2024

As a counterpoint, here's an example where the current character diffs do really well, but word diffs might not:

(before)

    var lis = this.props.filePairs.map((file_pair, idx) => {
      var content;
      if (idx != props.selectedIndex) {
        content = <a data-idx={idx} onClick={this.clickHandler} href='#'>
          {file_pair.path}</a>;
      } else {
        content = <b>{file_pair.path}</b>
      }
      return <li key={idx}>{content}</li>
    });
    return <ul className="file-list">{lis}</ul>

(after)

    var lis = this.props.filePairs.map((filePair, idx) => {
      var content;
      if (idx != props.selectedIndex) {
        content = <a data-idx={idx} onClick={this.clickHandler} href='#'>
          {filePair.path}</a>;
      } else {
        content = <b>{filePair.path}</b>;
      }
      return <li key={idx}>{content}</li>;
    });
    return <ul className="file-list">{lis}</ul>;

screen shot 2014-09-16 at 5 38 20 pm

from codediff.js.

danvk avatar danvk commented on July 30, 2024

Should be fixed by e8d7b91.

from codediff.js.

danvk avatar danvk commented on July 30, 2024

The '_p' → 'P' diff isn't ideal (shows up as '_pair' → 'Pair'), but otherwise this is a big win.

from codediff.js.

ryan-williams avatar ryan-williams commented on July 30, 2024

cool! fwiw, I don't mind file_pair -> FilePair showing up as a coarser / word-level diff.

also just saw this in the wild:
word-diff would win here.

happy to see this fixed

from codediff.js.

Related Issues (18)

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.