kahole / edamagit

Magit for VSCode
https://marketplace.visualstudio.com/items?itemName=kahole.magit
MIT License
1.12k stars 63 forks source link

Support word granularity #111

Open shirdekel opened 3 years ago

shirdekel commented 3 years ago

Would it be possible to implement something like magit-diff-refine-hunk (documented here)? It would help to identify individual word differences in long lines.

kahole commented 3 years ago

I would like this as well. It will require using a custom diff highlighter though as git diff --word-diff=color only shows the word differences. I've tried using VSCode's diff higlighting, but it's not part of their API yet. Using that or some JS fancy differ is likely the best bet. So this is a long term feature goal 👍 but I'm not sure when it'll come

Thanks for reporting

stevenguh commented 3 years ago

This probably won't add much, but as a reference this is the syntax language file vscode uses for .diff file. https://github.com/microsoft/vscode/blob/a699ffaee62010c4634d301da2bbdb7646b8d1da/extensions/git/syntaxes/diff.tmLanguage.json

EDIT: Diff2html could be an option if we ever go with a fancy js diff; however, it will probably break extensions like vim.