From 3c644f24365ee7c4517968d302e0ea6ec77e4f98 Mon Sep 17 00:00:00 2001 From: malc Date: Thu, 15 Nov 2012 00:45:35 +0400 Subject: [PATCH] Make escape exit link nav mode (when active) instead of quiting --- main.ml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/main.ml b/main.ml index 7c21aad..4ad9395 100644 --- a/main.ml +++ b/main.ml @@ -4734,12 +4734,18 @@ let viewkeyboard key mask = Wsi.setcursor Wsi.CURSOR_INHERIT; G.postRedisplay "kill zoom rect"; | _ -> - match state.ranchors with - | [] -> raise Quit - | (path, password, anchor) :: rest -> - state.ranchors <- rest; - state.anchor <- anchor; - opendoc path password + begin match state.mode with + | LinkNav _ -> + state.mode <- View; + G.postRedisplay "esc leave linknav" + | _ -> + match state.ranchors with + | [] -> raise Quit + | (path, password, anchor) :: rest -> + state.ranchors <- rest; + state.anchor <- anchor; + opendoc path password + end; end; | 0xff08 -> (* backspace *) -- 2.11.4.GIT