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 |
jonas
left a comment
There was a problem hiding this comment.
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.
| if (state && data && history->state_alloc && | ||
| !memcmp(state->data, data, history->state_alloc)) | ||
| return NULL; | ||
| return state; |
There was a problem hiding this comment.
Good catch. Return the current stack when nothing changed?
There was a problem hiding this comment.
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 jonas#1123
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