summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/browser/shell.ml
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>1999-12-09 15:08:02 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>1999-12-09 15:08:02 +0000
commit25376ca5353065d4bff039fc9a83d21b9bb58fe4 (patch)
treead3a50ff90f7901c989e9284d2d428fecbcdf9d5 /otherlibs/labltk/browser/shell.ml
parentb1231d6d1d68c0151a744919bec073d3940cc11e (diff)
improve shell and editor
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2679 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/browser/shell.ml')
-rw-r--r--otherlibs/labltk/browser/shell.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/otherlibs/labltk/browser/shell.ml b/otherlibs/labltk/browser/shell.ml
index 98e33bbc4..9dbe8a260 100644
--- a/otherlibs/labltk/browser/shell.ml
+++ b/otherlibs/labltk/browser/shell.ml
@@ -97,12 +97,14 @@ object (self)
if reading then reading <- false
else Text.mark_set textw mark:"input"
index:(`Mark"insert",[`Linestart;`Char 1]);
+ Text.mark_set textw mark:"insert"index:(`Mark"insert",[`Line 1]);
self#lex start:(`Mark"input",[`Linestart]) ();
let s =
(* input is one character before real input *)
Text.get textw start:(`Mark"input",[`Char 1])
end:(`Mark"insert",[]) in
h#add s;
+ Text.insert textw index:(`Mark"insert",[]) text:"\n";
self#send s;
self#send "\n"
method private paste ev =
@@ -116,7 +118,7 @@ object (self)
let rec bindings =
[ ([[],`KeyPress],[`Char],fun ev -> self#keypress ev.ev_Char);
([[],`KeyRelease],[`Char],fun ev -> self#keyrelease ev.ev_Char);
- ([[],`KeyPressDetail"Return"],[],fun _ -> self#return);
+ (* [[],`KeyPressDetail"Return"],[],fun _ -> self#return; *)
([[],`ButtonPressDetail 2], [`MouseX; `MouseY], self#paste);
([[`Alt],`KeyPressDetail"p"],[],fun _ -> self#history `previous);
([[`Alt],`KeyPressDetail"n"],[],fun _ -> self#history `next);
@@ -128,6 +130,8 @@ object (self)
List.iter bindings
fun:(fun (events,fields,f) ->
bind textw :events action:(`Set(fields,f)));
+ bind textw events:[[],`KeyPressDetail"Return"]
+ action:(`Setbreakable([], fun _ -> self#return; break()));
begin try
List.iter [in1;err1] fun:
begin fun fd ->