From 5e498f69ce034b276394529502d0e76873d3a3cb Mon Sep 17 00:00:00 2001 From: malc Date: Fri, 12 Aug 2011 10:54:20 +0400 Subject: [PATCH] Correct handling of enter when nothing is active --- main.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.ml b/main.ml index f334bb8..c5e3d16 100644 --- a/main.ml +++ b/main.ml @@ -2094,7 +2094,7 @@ let itemskeyboard key (active, first, items, qsearch, pan, oldmode) = Glut.postRedisplay (); | 13 -> (* enter *) - if active < Array.length items + if active >= 0 && active < Array.length items then ( match items.(active) with | _, _, Action f -> @@ -2103,6 +2103,10 @@ let itemskeyboard key (active, first, items, qsearch, pan, oldmode) = | _, _, Noaction -> state.text <- ""; state.mode <- oldmode + ) + else ( + state.text <- ""; + state.mode <- oldmode ); Glut.postRedisplay (); -- 2.11.4.GIT