Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to scroll diffs horizontally #1017

Closed
non-descriptive opened this issue Nov 29, 2021 · 11 comments · Fixed by #1327
Closed

Allow to scroll diffs horizontally #1017

non-descriptive opened this issue Nov 29, 2021 · 11 comments · Fixed by #1327
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@non-descriptive
Copy link

Sometimes there are diffs that a longer then console allows. It would be nice to have some kind of horizontal scroll to view whole diff.
image

First idea how to make it - allow scroll horizontally when right arrow button pressed in diff view. When left arrow pressed - reset horizontal scroll and change focus to changed/staged. It could be not really ergonomic in some cases since diff view resets.

Second idea - allow to reorder panels and make staged and unstaged stand side-by-side on top part and diff on the most of the bottom part of the console. The bad in this case - we need either divide vertical scrolling with buttons other then up/down arrow or make complicated jump keys to change focus back to file panels.

@extrawurst
Copy link
Owner

extrawurst commented Nov 30, 2021

I am torn here. On one side I would like to postpone this until we have diff rendering rewritten to be able to use delta first (see #358) which should also give us line wrapping.
on the other hand I can see a separate feature request here where we open up a diff in a fullscreen popup where we can scroll all directions freely🤔
If we do the latter it would be decoupled from the first.

@non-descriptive
Copy link
Author

non-descriptive commented Dec 1, 2021

Most editors usually configure word wrap, so might be a good idea to make it customizable as well. Like other git clients just use their own config section in .gitconfig (Source Tree, delta, and probably sublime merge, but not sure, ).
Also, when line wrap will be introduced not everyone will be happy with such change. Some files, like CSV, is good with word diffs but without line wrap.
I like the idea of separate popup. Also potential for conflict solver view.

@extrawurst
Copy link
Owner

Also, when line wrap will be introduced not everyone will be happy with such change

for sure this will be something to configure 👍

@extrawurst extrawurst added this to the v0.21 milestone Jan 25, 2022
@cruessler
Copy link
Contributor

@extrawurst Do you already know which direction you want to go? I just had a look at tig to see what it does, and it supports horizontal scrolling in diff views, among others. Would that be an option here? It would at least be reasonably simple to implement I hope.

@extrawurst
Copy link
Owner

yeah I was thinking about testing out horizontal scrolling while focusing on the diff. once we reach back to the left side another left command will select the index/wd side again

@M1cha
Copy link

M1cha commented Jul 5, 2022

For me personally, this is a very high priority issue since I have very little screen space(due to my UI scaling requirements) and even 100line-long code gets cut off.

So if there's any way to speed this up or pointers as for how I can implement it in a way that would be accepted in a PR, that'd be great 🙂

@extrawurst
Copy link
Owner

I would accept a PR for sure.
A POC that just uses the right-arrow to scroll as soon as the diff is selected and then left-arrow as long as we are not at the left border 👍

@extrawurst extrawurst modified the milestones: v0.21, v0.22 Aug 17, 2022
@extrawurst
Copy link
Owner

PR #1250 seems unmaintained, anyone up for grabs?

@extrawurst extrawurst added enhancement New feature or request good first issue Good for newcomers labels Sep 2, 2022
@cruessler
Copy link
Contributor

PR #1250 seems unmaintained, anyone up for grabs?

If it’s still unmaintained next week, I’d like to take a look (I’ll have a few weeks of vacation, and I’ll probably want to code a bit during that time). If anyone else wants to give it a try, go ahead!

@extrawurst
Copy link
Owner

@cruessler seems like you can take it away :)

@extrawurst extrawurst modified the milestones: v0.22, v0.23 Nov 19, 2022
@extrawurst
Copy link
Owner

@cruessler is going to provide this nice QoL feature for 0.23 - the PR is almost ready to merge 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
4 participants