summaryrefslogtreecommitdiff
path: root/gui/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-11-20 13:11:08 -0300
committerWerner Almesberger <werner@almesberger.net>2016-11-20 13:11:08 -0300
commit4881285222a520254a25e17c6748f638ffc2782d (patch)
treeaf4a64d448de0c9bfbe9ba1ded36cea520ef81bc /gui/gui.c
parente90e81202b07f9bf036018e95d7cd1af6a7288ee (diff)
downloadeeshow-4881285222a520254a25e17c6748f638ffc2782d.tar.gz
eeshow-4881285222a520254a25e17c6748f638ffc2782d.tar.bz2
eeshow-4881285222a520254a25e17c6748f638ffc2782d.zip
gui/gui.c (current_sheet): de-duplicate sheet selection logic
Diffstat (limited to 'gui/gui.c')
-rw-r--r--gui/gui.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gui/gui.c b/gui/gui.c
index c5d51a2..19d5eb9 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -74,6 +74,15 @@ struct gui_sheet *find_corresponding_sheet(struct gui_sheet *pick_from,
}
+struct gui_sheet *current_sheet(const struct gui *gui)
+{
+ if (!gui->old_hist || gui->diff_mode != diff_old)
+ return gui->curr_sheet;
+ return find_corresponding_sheet(gui->old_hist->sheets,
+ gui->new_hist->sheets, gui->curr_sheet);
+}
+
+
/* ----- AoIs -------------------------------------------------------------- */