Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/diff: fix LineEdits bug in slow path
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. Fixes golang/go#60379 Fixes golang/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>
- Loading branch information
Showing
4 changed files
with
25 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters