unexpected icon indicating copy to clipboard operation
unexpected copied to clipboard

Clean up stringDiff

Open papandreou opened this issue 8 years ago • 5 comments

When working on #270 we found out that the string diffing code is a terrible mess. We should figure out:

  1. Whether parts of it should be moved to a utility function so that the magicpen style only has to do with things that can strictly be considered styling
  2. If we can avoid prependLinesWith and the various hacks that necessitates with alt.

We can also think about making the diffing code a standalone magicpen plugin, and maybe even rework the diff library to support diffing the text in magicpen instances (so that we can do github-style diffs with syntax highlighting).

papandreou avatar Feb 29 '16 07:02 papandreou

What is your use case for github like diffs. Are you diffing a lot of source code?

sunesimonsen avatar Mar 02 '16 21:03 sunesimonsen

Doing better now as of #276.

papandreou avatar Mar 08 '16 08:03 papandreou

Whoops, accidentally replied to this on the wrong issue, copy/pasting here:

What is your use case for github like diffs. Are you diffing a lot of source code?

It'd be a nice-to-have for diffing messy.Http(Request|Response) bodies for which we have a syntax highlighter available, as determined by the Content-Type. Also, https://github.com/unexpectedjs/unexpected-function-equality would also benefit from being able to have the diffed code syntax highlighted.

... But I admit that I mostly bring it up because it'd be insanely cool to get it to work :)

papandreou avatar Mar 08 '16 08:03 papandreou

@papandreou did we manage to tackle this when we added the string diff collapsing stuff?

alexjeffburke avatar Dec 11 '19 19:12 alexjeffburke

No, I'm fairly sure it's still a mess.

papandreou avatar Dec 11 '19 19:12 papandreou