From 344d640c1af55a596f18ee29cf3e740d3e269f05 Mon Sep 17 00:00:00 2001 From: malc Date: Wed, 29 Jun 2016 12:37:38 +0300 Subject: [PATCH] Cosmetics --- main.ml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/main.ml b/main.ml index 556a040..61a7f3f 100644 --- a/main.ml +++ b/main.ml @@ -1987,20 +1987,15 @@ let linknact f s = ;; let linknentry text key = - let c = - if key >= 32 && key < 127 - then Char.chr key - else '\000' - in - match c with - | 'a' .. 'z' -> - let text = addchar text c in - linknact (fun under -> state.text <- undertext ~nopath:true under) text; - TEcont text - - | _ -> - state.text <- Printf.sprintf "invalid char (%d, `%c')" key c; - TEcont text + if key >= 32 && key < 127 + then + let text = addchar text (Char.chr key) in + linknact (fun under -> state.text <- undertext ~nopath:true under) text; + TEcont text + else ( + state.text <- Printf.sprintf "invalid char %d" key; + TEcont text + ) ;; let textentry text key = -- 2.11.4.GIT