jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.07k stars 1.82k forks source link

Line wrap for diff/staging mode (or hunk navigation in files mode) #3558

Open tipa40 opened 5 months ago

tipa40 commented 5 months ago

Hi, I would find it very useful with a line wrapping key binding/toggle/config param to get the full line content overview in that mode.

Motivation: For me the motivation is that I have files where I am storing text files with very long line content where I store paragraph long text in a single line on many places. Making a modification to such paragraph/line will not too rarely put my changes out of initial view when reviewing and commenting my changes for the commit text. Even so in fullscreen mode for the "Staged changes" pane. I know I have the options to scroll sideways in diff/staging mode or use the files view instead. The reasons I find them insufficient is that scrolling long lines is tedious, and in the files view there is no binding for jumping to next/previous hunk. If there was a binding for next/previous hunk I would think that it would also suffice as a solution for me. I also tried changing the git->paging->pager to ydiff, but could see that it does not affect the diff/staging mode, only the files mode. If this is enough motivation for you to implement it though is of course up to you, but would be greatly appreciated! :)

abhinavnatarajan commented 4 months ago

This would be an amazing feature to have! This is particularly challenging when working with .tex files or markdown. I work on shared projects with several collaborators where the convention is for each line in the file to be a sentence for ease of diffing. Right now I revert to using an editor with soft-wrapping enabled to manually stage hunks or view diffs because often the changes are beyond the scrolloff of the diff view in lazygit. Entering the diff view and scrolling is annoying since I need to keep scrolling back and forth for different lines.

lorenuars19 commented 3 months ago

:+1: on this feature or at least another scroll bar

Twiggeh commented 2 months ago

:+1: We already have this in commit messages, would be very nice