]> git.mdlowis.com Git - archive/tide-ocaml.git/commitdiff
added stubs for fetch and exec
authorMichael D. Lowis <mike@mdlowis.com>
Fri, 26 Jan 2018 02:51:46 +0000 (21:51 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Fri, 26 Jan 2018 02:51:46 +0000 (21:51 -0500)
edit.ml
lib/view.ml
lib/view.mli

diff --git a/edit.ml b/edit.ml
index c174ac70e00d7073566ada089b4cd03dc0bdbc20..a95045bf078df7c0418f6d2e5c8e012c950ab50d 100644 (file)
--- a/edit.ml
+++ b/edit.ml
@@ -18,15 +18,21 @@ let scroll_dn () =
 let onselect mods x y nclicks =
   Printf.printf "select (%d,%d) %d" x y nclicks;
   print_endline "";
-  edit_view := View.select_at !edit_view x y
+  match nclicks with
+  | 1 -> edit_view := View.select_at !edit_view x y
+  | 2 -> () (* edit_view := View.select_ctx_at !edit_view x y *)
+  | 3 -> () (* edit_view := View.select_line_at !edit_view x y *)
+  | _ -> ()
 
 let onexec mods x y nclicks =
   Printf.printf "exec (%d,%d) %d" x y nclicks;
-  print_endline ""
+  print_endline "";
+  edit_view := View.exec_at !edit_view x y
 
 let onfetch mods x y nclicks =
   Printf.printf "fetch (%d,%d) %d" x y nclicks;
-  print_endline ""
+  print_endline "";
+  edit_view := View.fetch_at !edit_view x y
 
 (* Event functions
  ******************************************************************************)
index 8f0fde9db5692f3035fba010854807bfc7eb553c..6dad1dc5b9d2ad4482ef7a5546266831dfb83745 100644 (file)
@@ -55,6 +55,18 @@ let select ?extend:(ext=false) view pos =
 let select_at ?extend:(ext=false) view x y =
   select ~extend:ext view (get_at view x y)
 
+let exec view pos =
+  view
+
+let exec_at view x y =
+  exec view (get_at view x y)
+
+let fetch view pos =
+  view
+
+let fetch_at view x y =
+  fetch view (get_at view x y)
+
 let path view =
   Buf.path view.buf
 
index a5048ca27bd4b63cb9fb2743bf479e22fc0abb50..f45c28487412e6f811f8f078686799ba78511cb5 100644 (file)
@@ -13,3 +13,10 @@ val scroll_params : t -> (float * float)
 
 val select : ?extend:bool -> t -> int -> t
 val select_at : ?extend:bool -> t -> int -> int -> t
+
+val exec : t -> int -> t
+val exec_at : t -> int -> int -> t
+
+val fetch : t -> int -> t
+val fetch_at : t -> int -> int -> t
+