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

DiffMain does not show deleted space #96

Open
mingrammer opened this issue Nov 30, 2018 · 1 comment
Open

DiffMain does not show deleted space #96

mingrammer opened this issue Nov 30, 2018 · 1 comment

Comments

@mingrammer
Copy link

mingrammer commented Nov 30, 2018

package main

import (
	"fmt"

	"github.com/sergi/go-diff/diffmatchpatch"
)

const (
	text1 = "package casec"
	text2 = "PackageCasec"
)

func main() {
	dmp := diffmatchpatch.New()

	diffs := dmp.DiffMain(text1, text2, false)

	fmt.Println(dmp.DiffPrettyText(diffs))
}

I expected the diff output results for above code to be one of pPackagecCasec or pPackage[x]cCasec, but it printed pPackage cCasec instead. ([x] indecates a space letter with red background)

So it was a little hard for me to recognize the space was deleted or not. I think DiffMain also should show the status of added or deleted space letters. I think it could be achieved using "space letter with a red or green background".

@melg8
Copy link

melg8 commented Nov 5, 2024

I also encountered same issue: it doesnt show space difference between strings.

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

No branches or pull requests

2 participants