Consider the following text file containing a UTF character followed by newline:
❯ cat foo.txt
━
Here is the hex dump for clarity:
❯ xxd -p foo.txt
e294810a
Delta will interpret regular rg output just fine:
❯ rg "" foo.txt | delta
━
But it will panic when using JSON output:
❯ rg --json "" foo.txt | RUST_BACKTRACE=1 delta
thread 'main' panicked at src/handlers/grep.rs:389:50:
byte index 1 is not a char boundary; it is inside '━' (bytes 0..3) of `━`
stack backtrace:
• foo.txt
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::str::slice_error_fail_rt
3: core::str::slice_error_fail
4: delta::handlers::grep::make_style_sections
5: delta::handlers::grep::<impl delta::delta::StateMachine>::handle_grep_line
6: delta::delta::delta
7: delta::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Consider the following text file containing a UTF character followed by newline:
Here is the hex dump for clarity:
Delta will interpret regular
rg
output just fine:But it will panic when using JSON output: