Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

word level diff #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

word level diff #15

wants to merge 1 commit into from

Conversation

wkpark
Copy link

@wkpark wkpark commented May 13, 2015

this is a quick hack to support word level diff with viewType = 2 param.

    viewType:2,
    contextSize: 3

Please see http://moniwiki.kldp.net/diff.html

@wkpark wkpark mentioned this pull request May 13, 2015
@srgsanky
Copy link

Is viewType=2 still supported? The code tends to default to 0 if we use 2. See https://github.com/cemerick/jsdifflib/blob/master/diffview.js#L54

@@ -51,7 +51,8 @@ diffview = {
var baseTextName = params.baseTextName ? params.baseTextName : "Base Text";
var newTextName = params.newTextName ? params.newTextName : "New Text";
var contextSize = params.contextSize;
var inline = (params.viewType == 0 || params.viewType == 1) ? params.viewType : 0;
var inline = (params.viewType == 0 || params.viewType >= 1) ? params.viewType : 0;
Copy link

@Goodwine Goodwine Jun 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should update params.viewType to use a 1 instead of params.viewType.
Also I think it would look better if it instead did this (depending on whether viewType is used in more places or not(?):

var inline = params.viewType ? 1 : 0;

@Sivolen
Copy link

Sivolen commented May 12, 2023

I encountered such a problem that in those places where characters have changed, it draws lines without spaces like "destination10.0.1.96"
i fixed it, changed the regex ([^\S]+|[a-zA-Z0-9_-]+|.)(?:(?!<)[^\S\s])?
I think it looks better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants