forgit: Delta side-by-side not displayed correctly on fzf preview window
Check list
- I have read through the README
- I have the latest version of forgit
- I have searched through the existing issues
Environment info
- OS
- Linux
- Mac OS X
- Windows
- Others:
- Shell
- bash
- zsh
- fish
Problem / Steps to reproduce
I have been using forgit for a while and so far I love it! A while ago I switched to delta to display the diff however if I toggle the side-to-side option in delta in the preview window looks all squished to the left of the preview window with very narrow panels for each side of the diff. However, this only happens in forgit as if I run git diff I see the side to side no problems spanning the whole window. (I attached a screenshot)

Am I missing something here? Is this a fzf option maybe? I have been looking for days and I cannot find anything 😅
Thank you for your help in advance, I love this tool very much, keep up the good work!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 25 (4 by maintainers)
Commits related to this issue
- [git] add adaptive delta side-by-side feature ref: https://github.com/wfxr/forgit/issues/121#issuecomment-725811214 — committed to ytian81/dot-files by ytian81 3 years ago
- Fix forgit delta width. See https://github.com/wfxr/forgit/issues/121#issuecomment-725358145. — committed to orangeturtle739/jgns by orangeturtle739 3 years ago
- :adhesive_bandage: forgit: fix delta display issue https://github.com/wfxr/forgit/issues/121 — committed to gitetsu/dotfiles by gitetsu 2 years ago
- :bug: gitconfig: add width flag to delta diff tool See https://github.com/wfxr/forgit/issues/121 — committed to cristianmiranda/dotfiles by cristianmiranda a year ago
- :bug: gitconfig: add width flag to delta diff tool See https://github.com/wfxr/forgit/issues/121 — committed to cristianmiranda/dotfiles by cristianmiranda a year ago
- :bug: gitconfig: add width flag to delta diff tool See https://github.com/wfxr/forgit/issues/121 — committed to cristianmiranda/dotfiles by cristianmiranda a year ago
- :bug: gitconfig: add width flag to delta diff tool See https://github.com/wfxr/forgit/issues/121 — committed to cristianmiranda/dotfiles by cristianmiranda a year ago
A workaround based on @Kr1ss-XD 's comment:
<strike>The only cons of this solution is it need to be set manually instead of reading from git’s config automatically. </strike>
EDIT: You can also make it work by changing git’s config:
@mrswats @crivotz
@wfxr this worked for me
it seems that git uses
shto run this command, and${var:-word}is a bashism, so this explicitly uses bash@mrswats Thanks for your help and suggestion. I will pin this issue (until it gets fixed more elgantly) so that others with the same problem will easily find the solution.
BTW I like delta’s
side-by-sideview but it is not suitable when the window is narrow. So I use the following config that can auto switch to the classic view when the with of window is less than 160. Hope it can help you too.EDIT: A little more complicated but better config:
Nice ! If that is the issue, it might also suffice to simply omit the
::I think that’s valid
shsyntax. Not tested though - I’m on mobile right now.Okay, just right after comenting the other issue the first open issue in delta is this one: https://github.com/dandavison/delta/issues/368 which is exactly the issue I reported.
@0xRZ Have you exported your
FZF_PREVIEW_COLUMNSandCOLUMNSvariables? Otherwiseforgithas no access to them.This solution stopped working for me on
fzf 0.35.1,delta 0.15.1:pager = delta --width ${FZF_PREVIEW_COLUMNS-$COLUMNS}It says
error: The argument '--width <N>' requires a value but none was suppliedwhen trying to open diff withforgit::diff