You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the main view can't be focused. It can be scrolled with pgup/pgdn or with c-d/c-u, but that's very non-standard and hard to discover. Also, it goes only line by line; it would be useful to be able to scroll by pages.
It would be nice if there was a way to focus the main view, including having a selection that can be moved up/down like in all other views (up/down for line by line, ,/. by page, </> for beginning/end). This would also allow searching the main view.
And, together with #3986, it would make it possible to select a line in the main view, and then either hit e to edit the file at that line, or enter to go to the staging view.
Challenges/open questions:
Clicking in the main view. Right now, clicking in the diff of a commit does nothing, so this can easily focus the main view and select the clicked line. However, if a file is selected in the files panel, then clicking in the diff currently enters staging (with all the caveats mentioned in Improve clicking in diff view to enter staging/patch building #3986), so selecting the line would be a behavior change that might be annoying for existing users; you'd need an extra enter key press to enter staging.
Focusing the main view with the keyboard. This needs a new key, since enter is already taken. Maybe 0 would make sense (in analogy to 1-5 for the side panels).
One detail consideration: which line do we select when hitting the key? Users might already have scrolled with the wheel, in which case it would be annoying to select the first line (and jump back to the top). Maybe we should always select the line that is in the middle of the screen?
Hitting escape to go "out". In some cases it will be possible to jump from the main view to another view, e.g. from a diff to the staging view. When hitting escape, should we put the focus back to the main view that we came from, or focus the side panel like we do today? I suppose the latter would be easier to implement, since we may have to rerender the main view after coming back from staging.
The text was updated successfully, but these errors were encountered:
- **PR Description**
This adds a new `0` keybinding to the side panels that focuses whatever
main view is currently displayed, with the goal of making it easier to
scroll the main view (using the normal navigation keys `,` `.` `<` `>`),
and being able to search the main view using `/`.
Alternatively to pressing `0` you can also click the main view to focus
it. Note that previously it was possible to go directly to the staging
panel by clicking in the main view when a file was selected; this now
takes a double click, because the first click just focuses the main
view, but you can go to staging from there by clicking again.
I'm reasonably happy with the overall behavior, but it takes some
getting used to, so we'll want to test this for a while to see if it
doesn't make the focus handling too confusing.
Fixes#3988.
Currently the main view can't be focused. It can be scrolled with pgup/pgdn or with c-d/c-u, but that's very non-standard and hard to discover. Also, it goes only line by line; it would be useful to be able to scroll by pages.
It would be nice if there was a way to focus the main view, including having a selection that can be moved up/down like in all other views (up/down for line by line,
,
/.
by page,<
/>
for beginning/end). This would also allow searching the main view.And, together with #3986, it would make it possible to select a line in the main view, and then either hit
e
to edit the file at that line, orenter
to go to the staging view.Challenges/open questions:
enter
key press to enter staging.enter
is already taken. Maybe0
would make sense (in analogy to1
-5
for the side panels).The text was updated successfully, but these errors were encountered: