Skip to content

Improve one common case for multiline diffing#1

Open
vors wants to merge 2 commits intoReviewable:masterfrom
vors:sergei/better-line-diff
Open

Improve one common case for multiline diffing#1
vors wants to merge 2 commits intoReviewable:masterfrom
vors:sergei/better-line-diff

Conversation

@vors
Copy link
Copy Markdown

@vors vors commented Sep 25, 2022

Addresses the following case:

def x():
    pass

def y():
    pass

def z():
    pass
def x():
    pass

def z():
    pass

Previously

image

Now

image

Implementation

We piggy-back on the existing diff_main opt_checklines bool flag to make the common prefix and suffix heuristics respect this flag. Concretely they will only cut away the prefix/suffix that ends/starts with \n.


This change is Reviewable

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.

1 participant