If we take this Rust code:
z.rs
// this is a comment
let x = "this is code";
and this Python code:
z.py
# this is a comment
x = "this is code"
Then delta's rg --json handling correctly highlights the Rust:

But is incorrect for Python: the syntax highlighting state incorrectly remains in comment mode on the second line:

I'm not sure if this is a bug in syntect or delta. I notice that in grep.rs our line of code does not have a terminal \n; adding this (with push('\n') in ripgrep_json.rs) fixes the issue superficially, but if the user has requested multiple context lines then it introduces undesired extra blank lines.
If we take this Rust code:
z.rsand this Python code:
z.pyThen delta's

rg --jsonhandling correctly highlights the Rust:But is incorrect for Python: the syntax highlighting state incorrectly remains in comment mode on the second line:

I'm not sure if this is a bug in syntect or delta. I notice that in
grep.rsour line of code does not have a terminal\n; adding this (withpush('\n')inripgrep_json.rs) fixes the issue superficially, but if the user has requested multiple context lines then it introduces undesired extra blank lines.