kworkflow / patch-hub

patch-hub is a TUI that streamlines the interaction of Linux developers with patches archived on lore.kernel.org
GNU General Public License v2.0
8 stars 6 forks source link

Trailing `--` that marks end of patch is considered deletion in patch preview with `bat`, `delta`, and `diff-so-fancy` #76

Open davidbtadokoro opened 1 month ago

davidbtadokoro commented 1 month ago

Description:

In patches, it is common to have a trailing line like

--
2.34.1 # or something similar

This is part of the patch when previewing, and it gets interpreted as a deletion line in the renderers bat, delta, and diff-so-fancy.

How to reproduce:

Choose one of these renderers on the "Edit Config" screen and select a patchset in a list/the bookmarked. You'll probably see something like the screenshots below.

Expected behavior:

This -- line should be excluded from the "diffing" and not be understood and rendered as a deletion. These two ending lines are (maybe) irrelevant to the previewing, so we can also avoid this behavior by removing those.

Screenshots

bat

2024-10-28-122720_1894x1027_scrot

delta

2024-10-28-122737_1894x1027_scrot

diff-so-fancy (note that there is also a white cursor, which I interpret as a blank line addition, but can't confirm it)

2024-10-28-122758_1894x1027_scrot

Setup: