Skip to content

Enable jumping back in main view#1138

Merged
koutcher merged 2 commits intojonas:masterfrom
kempniu:jump-back-in-main-view
Oct 4, 2021
Merged

Enable jumping back in main view#1138
koutcher merged 2 commits intojonas:masterfrom
kempniu:jump-back-in-main-view

Conversation

@kempniu
Copy link
Copy Markdown
Contributor

@kempniu kempniu commented Aug 12, 2021

Hi there,

First, thank you for all the work on this awesome tool.

The one feature that I have been missing is the ability to go back to the previously selected commit after jumping to its parent. I find that to be really useful for git repositories which are "heavily non-linear" (like the Linux kernel tree).

I see this idea has already been suggested in #628 and also in #506 (which implemented #388), so I took a stab at implementing it.

This PR looks almost too simple to be right, but it seems to work well for me :-) I would be happy to work on it further if the approach I chose is not the preferred one.

Hope this helps!

Allow going back to the previously selected commit after jumping to its
parent.

Fixes #628
@krobelus
Copy link
Copy Markdown
Contributor

Wow I never thought of using :parent in main view - LGTM

@koutcher
Copy link
Copy Markdown
Collaborator

Thanks, this makes the navigation in a messy git history really much easier.

@koutcher koutcher merged commit 2e31516 into jonas:master Oct 4, 2021
@typebrook
Copy link
Copy Markdown
Contributor

Works like a charm! Thank you @kempniu

koutcher added a commit to koutcher/tig that referenced this pull request Jan 4, 2022
With jonas#1138, using `:parent` after reaching an initial commit will keep
pushing the same state in the main view history, and `:back` must then
be used several times before it starts moving. Use lineno as data to
prevent pushing the same history state.

This a complement to 2e31516.
vxsl pushed a commit to vxsl/tig that referenced this pull request Mar 18, 2026
Allow going back to the previously selected commit after jumping to its
parent.

Fixes jonas#628

[tk: added test]
vxsl pushed a commit to vxsl/tig that referenced this pull request Mar 18, 2026
With jonas#1138, using `:parent` after reaching an initial commit will keep
pushing the same state in the main view history, and `:back` must then
be used several times before it starts moving. Use lineno as data to
prevent pushing the same history state.

This a complement to 2e31516.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants