summaryrefslogtreecommitdiff
path: root/gui/sheet.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-11-29 10:07:02 -0300
committerWerner Almesberger <werner@almesberger.net>2016-11-29 10:07:02 -0300
commitaaa81ab1fcf43f824f364ebbb80efed57b518ce9 (patch)
tree7b8cad85721ba72ed16950db4540d0b8869591c0 /gui/sheet.c
parent025d5951aabf6c69109c15ca3a13808820c57125 (diff)
downloadeeshow-aaa81ab1fcf43f824f364ebbb80efed57b518ce9.tar.gz
eeshow-aaa81ab1fcf43f824f364ebbb80efed57b518ce9.tar.bz2
eeshow-aaa81ab1fcf43f824f364ebbb80efed57b518ce9.zip
gui/sheet.c (show_key): don't change diff mode if we have no history
If we have no history, trying to change the diff mode through keyboard shortcuts crashed eeshow when trying to set up the revision overlays. Reported by Alvaro Gamez Machado.
Diffstat (limited to 'gui/sheet.c')
-rw-r--r--gui/sheet.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gui/sheet.c b/gui/sheet.c
index f89b4db..e521a95 100644
--- a/gui/sheet.c
+++ b/gui/sheet.c
@@ -630,21 +630,29 @@ static void sheet_key(void *user, int x, int y, int keyval)
break;
case GDK_KEY_n:
+ if (!have_history(gui))
+ break;
gui->diff_mode = diff_new;
do_revision_overlays(gui);
redraw(gui);
break;
case GDK_KEY_o:
+ if (!have_history(gui))
+ break;
gui->diff_mode = diff_old;
do_revision_overlays(gui);
redraw(gui);
break;
case GDK_KEY_d:
+ if (!have_history(gui))
+ break;
gui->diff_mode = diff_delta;
do_revision_overlays(gui);
redraw(gui);
break;
case GDK_KEY_D: /* Shift + D */
+ if (!have_history(gui))
+ break;
use_delta = !use_delta;
do_revision_overlays(gui);
redraw(gui);