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

feat(vscode): show inline diff of characters #3709

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zhanba
Copy link
Contributor

@zhanba zhanba commented Jan 16, 2025

@zhanba zhanba force-pushed the feat-inline-char-diff branch from 3bd2214 to eabbc1e Compare January 16, 2025 05:50
@wsxiaoys wsxiaoys changed the title feat: show inline diff of characters feat(vscode): show inline diff of characters Jan 17, 2025
@icycodes
Copy link
Member

Hi @zhanba
Thank you for the PR.

I created a simple snippet to test the diff decoration, but it doesn't seem to handle this case properly. Could you please take a look?
Screenshot from 2025-01-17 18-32-13

@zhanba zhanba force-pushed the feat-inline-char-diff branch from eabbc1e to 491c8bb Compare January 17, 2025 13:07
@zhanba
Copy link
Contributor Author

zhanba commented Jan 17, 2025

Hi @zhanba Thank you for the PR.

I created a simple snippet to test the diff decoration, but it doesn't seem to handle this case properly. Could you please take a look? Screenshot from 2025-01-17 18-32-13

Fix some decoration calculation error. For this case, we can only get below result due to limitation of the diff package.
image

jsdiff playground:
image

The monaco diff editor show a better result, I will check if we can use the monaco diff algorithm.
image

@zhanba zhanba force-pushed the feat-inline-char-diff branch from a76b31a to 90e9e70 Compare January 19, 2025 14:24
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.

2 participants