sourcegit icon indicating copy to clipboard operation
sourcegit copied to clipboard

[Bug] Python syntax highlighting bugged on multiline string

Open bwachtendorf opened this issue 1 year ago • 2 comments

When displaying changes with a python multiline string where the start of the string is not visible in the diff, the syntax highlighting will break and interpret everything as a string. Example: syntax_highlighting_bugged

The bug disappears when increasing visible lines until the start of the string is visible. Example: syntax_highlighting_works

bwachtendorf avatar Oct 09 '24 08:10 bwachtendorf

... In fact, it's not a BUG. Syntax highlighting does not guarantee exactly correct execution in git hunks, since the context lines that have not been changed may not be included.

love-linger avatar Oct 10 '24 01:10 love-linger

I think it can be fixed if whole file is highlighted first, but then it will add a whole lot of complexity to reconstruct diff view. Better to mark it as not-planned than invalid?

aikawayataro avatar Oct 10 '24 02:10 aikawayataro