From: Michael D. Lowis Date: Fri, 26 Jan 2018 02:51:46 +0000 (-0500) Subject: added stubs for fetch and exec X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=3333cc3596c29c340c9666736d13eacb29f8b419;p=archive%2Ftide-ocaml.git added stubs for fetch and exec --- diff --git a/edit.ml b/edit.ml index c174ac7..a95045b 100644 --- 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 ******************************************************************************) diff --git a/lib/view.ml b/lib/view.ml index 8f0fde9..6dad1dc 100644 --- a/lib/view.ml +++ b/lib/view.ml @@ -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 diff --git a/lib/view.mli b/lib/view.mli index a5048ca..f45c284 100644 --- a/lib/view.mli +++ b/lib/view.mli @@ -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 +