-
Notifications
You must be signed in to change notification settings - Fork 622
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 :back to work across separate blame views #1127
Conversation
* stop clearing the history state when entering the blame view * push a blame view history state before entering the diff view * stop failing when trying to push an identical history state Closes jonas#1123
Thanks, this works great! I felt like it would be easy but I didn't understand enough of the view code.
Makes sense, this is required so we don't error on |
I found a similar use case for the diff view.
|
There is an issue when the diff view is the initial view. Here is a quick fix but I'm not completely sure it's the right way to do: --- a/src/diff.c
+++ b/src/diff.c
@@ -34,6 +34,9 @@ diff_open(struct view *view, enum open_flags flags)
};
enum status_code code;
+ if (is_initial_view(view) && opt_rev_args)
+ string_copy_rev(argv_env.commit, opt_rev_args[0]);
+
diff_save_line(view, view->private, flags);
code = begin_update(view, NULL, diff_argv, flags); |
Fixes the first issue described in jonas#1127 (comment)
I've openend #1135 with my attempt at a different fix. It's a bit hacky, I'll recheck it soon. The other issue with the diff-view history would be solved if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of keeping the history across "blame uses". The initial use case was mostly to be able to deep dive and drill down into "parent blame views". But more horizontal exploration also makes sense.
@@ -393,7 +393,7 @@ push_view_history_state(struct view_history *history, struct position *position, | |||
|
|||
if (state && data && history->state_alloc && | |||
!memcmp(state->data, data, history->state_alloc)) | |||
return NULL; | |||
return state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Return the current stack when nothing changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise reopening the same blame fails.
stop clearing the history state when entering the blame view
push a blame view history state before entering the diff view
stop failing when trying to push an identical history state
Closes #1123