jcs
/amend
/amendments
/8
browser: Fix diff viewing in a filtered commit list
jcs made amendment 8 over 3 years ago
--- browser.c Mon Oct 18 13:09:06 2021
+++ browser.c Tue Oct 19 17:50:24 2021
@@ -414,9 +414,10 @@ browser_mouse_down(struct browser *browser, EventRecor
Point p;
ControlHandle control;
Rect r;
+ struct repo_commit *commit = NULL;
short *selected_files = NULL, *now_selected_files = NULL;
short nselected = 0, nnow_selected = 0;
- short val, adj, page, was_selected, part, i;
+ short val, adj, page, was_selected, part, i, data_len;
char *path;
p = event->where;
@@ -492,7 +493,11 @@ browser_mouse_down(struct browser *browser, EventRecor
if (was_selected)
LSetSelect(false, selected, browser->commit_list);
LSetSelect(true, now, browser->commit_list);
- browser_show_commit(browser, browser->repo->commits[now.v]);
+
+ /* in a filtered list, commits[now.v] won't be accurate */
+ data_len = sizeof(Ptr);
+ LGetCell(&commit, &data_len, now, browser->commit_list);
+ browser_show_commit(browser, commit);
}
return;