You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The x/tools diff algorithm reports correct but non-minimal diffs even for the trivial case where a new line is inserted in the middle of a two-line file. For example:
Previously, the expandEdit operation would expand to
the end of the line unconditionally, but this caused it
to gulp an extra line if it was already line-aligned.
This change causes it to do the expansion only if
the end is not line-aligned, or the replacement text
doesn't end with a newline.
Now, removing the fast path no longer causes tests to fail.
This also allows us to remove the logic added in CL 489695
to work around issue golang/go#59232.
Fixesgolang/go#60379Fixesgolang/go#59232
Change-Id: Ia40e4e3bb714d75acb95103a38e8c49a8ef456de
Reviewed-on: https://go-review.googlesource.com/c/tools/+/499377
Run-TryBot: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
The x/tools diff algorithm reports correct but non-minimal diffs even for the trivial case where a new line is inserted in the middle of a two-line file. For example:
GNU diff -u:
diff.Unified:
We should match the GNU diff behavior in cases this simple.
The text was updated successfully, but these errors were encountered: