-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
diff: alter foreground color as well #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
@@ -164,13 +164,7 @@ func DiffPrettyText(diffs []diffmatchpatch.Diff) string { | |||
|
|||
switch diff.Type { | |||
case diffmatchpatch.DiffInsert: | |||
for _, c := range text { | |||
if unicode.IsSpace(c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't delete this if branch.
Just set foreground color on L171.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
to keep readable contrast between bg and fg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you! :)
@sachaos just discovered viddy today. I find it succint and elegant, and it solves very real problem. For me it's being able to scroll. Than you for your work! |
@sachaos hi, how are you :) Do you remember that loop, which highlights each individual character in the diff. There is an issue with that, if there are already colors in the text, before coloring diff, so invisible Maybe we should remove such things from the string before applying green? |
@NikolayXHD Hi, thank you for your bug report. |
Should not be caused by this MR, new discussion |
to keep readable contrast between bg and fg
example:
before
after