jesseduffield / lazygit

simple terminal UI for git commands
MIT License
50.97k stars 1.79k forks source link

Delta does not color whole lines #1386

Closed matejcik closed 2 years ago

matejcik commented 3 years ago

Describe the bug when using delta as pager, the background color for changed lines only goes up to EOL

To Reproduce follow instructions to set up delta: https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md

Problem behavior

image

Expected behavior this is how it should be, and what delta does when run as git diff somefile image it's also what the guide shows: image

Desktop (please complete the following information):

matejcik commented 3 years ago

presumably you either need to pass --width to delta, or somehow pass the "terminal" width.

I can try to implement the former, either by something like auto-figuring-out options for delta, or some sort of configurable parameter on the command line?

matejcik commented 3 years ago

this is especially a problem for empty-line differences :eyes:

jesseduffield commented 3 years ago

as discussed on slack the file to look at is vendor/github.com/jesseduffield/gocui/escape.go: we're failing to properly interpret an escape sequence that says 'finish this line off'

matejcik commented 3 years ago

This is fixed in master of gocui already.

I have a 6-line patch for the version in awesome branch, so I can send that as a PR if you like. Porting the version from master, or making lazygit use gocui master, is probably beyond me though.

jesseduffield commented 2 years ago

@matejcik that PR would be good, lemme know if you need any pointers

matejcik commented 2 years ago

i believe this was fixed in #1527 ?

kkonevets commented 1 month ago

Still not fixed in 0.43.1

commit=71ad3fac63a3ef3326021837b49e9497d332818b, build date=2024-07-13T10:24:19Z, build source=binaryRelease, version=0.43.1, os=linux, arch=amd64, git version=2.34.1
stefanhaller commented 1 month ago

Ah damn. It's actually not "Still not fixed"; it was fixed for two years, but I broke it again in 0.42 with this commit.

Unfortunately, just reverting that commit is not enough to fix the regression; this would expose other bugs that I fixed with that commit, so those then need to be fixed in other ways. I probably won't have time to work on this today, but should be able to get something working next week.

stefanhaller commented 1 month ago

@kkonevets Here's a PR in case you want to test it: #3820

kkonevets commented 1 month ago

@kkonevets Here's a PR in case you want to test it: #3820

thanks!