dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
24.66k stars 395 forks source link

🚀 Improve syntax highlighting by narrowing context #1091

Open ideasman42 opened 2 years ago

ideasman42 commented 2 years ago

Sometimes syntax highlighting is wrong, especially when the patch text begins in the middle of a multi-line comment or string.

This could be resolved by inputting a wider context e.g.

git show HEAD -U100000000 | delta --side-by-side

... however this creates a much larger output.

This could be resolved by supporting narrowing the text displayed before/after in delta, e.g.

git show HEAD -U100000000 | delta --side-by-side -U4

... which would syntax highlight using the wider context and only show fewer lines with delta's output.

dandavison commented 2 years ago

Hi @ideasman42, I agree, this sounds like a pretty good suggestion. Ref https://github.com/dandavison/delta/issues/117

dandavison commented 10 months ago

Sorry there's been no action here. I still think this is a very good suggestion (and one which I had not thought of).

ofek commented 2 weeks ago

Has there been any progress on this? I couldn't find a PR.

dandavison commented 2 weeks ago

Hi @ofek, no, this has not been implemented by anyone yet.