lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Can't use custom pager when focused on Changes

Open Saafo opened this issue 2 years ago • 1 comments

Describe the bug I follow the Custom_Pagers - delta config and change pager to delta, it work well when focusing on commits or files tab, but cannot work when focusing on changes tab.

To Reproduce Steps to reproduce the behavior:

  1. config delta and lazygit delta config
  2. do some changes in a repo
  3. open lazygit and focus on Files tab
  4. enter to focus changes on one file (focus on Changes tab), custom pagers cannot work

Expected behavior When focusing on Changes tab, custom pager still works

Screenshots image image

Version info: Run lazygit --version and paste the result here Run git --version and paste the result here

commit=, build date=, build source=homebrew, version=0.37.0, os=darwin, arch=arm64, git version=2.40.0

Additional context Add any other context about the problem here.

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.

Saafo avatar Apr 23 '23 06:04 Saafo

I can see how this might seem desirable, but I don't think it's possible to achieve. Pagers can do more than just coloring the diff; they can also change the diff text structurally (think of delta --side-by-side as an extreme example of this). There's no way for lazygit to tell how line indices in the view map to line indices in the original diff.

See also https://github.com/jesseduffield/lazygit/issues/2117.

stefanhaller avatar Apr 23 '23 09:04 stefanhaller

I can see how this might seem desirable, but I don't think it's possible to achieve. Pagers can do more than just coloring the diff; they can also change the diff text structurally

delta actually has a switch to address exactly this issue:

--color-only

Do not alter the input structurally in any way.
But color and highlight hunk lines according to your delta configuration.
This is mainly intended for other tools that use delta.

redstreet avatar Sep 09 '23 06:09 redstreet