File: zed_macro.mli

package info (click to toggle)
zed 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 480 kB
  • ctags: 1,251
  • sloc: ml: 8,828; makefile: 64
file content (55 lines) | stat: -rw-r--r-- 1,501 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
(*
 * zed_macro.mli
 * -------------
 * Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
 * Licence   : BSD3
 *
 * This file is a part of Zed, an editor engine.
 *)

(** Macro recorder *)

type 'a t
  (** Type of macro recorders. *)

val create : 'a list -> 'a t
  (** [create macro] create a new macro recorder, with initial
      contents [macro]. *)

val recording : 'a t -> bool React.signal
  (** Whether the recorder is recording a macro. *)

val get_recording : 'a t -> bool
  (** Returns the current state of the recorder. *)

val set_recording : 'a t -> bool -> unit
  (** Starts or stops the macro recorder. *)

val cancel : 'a t -> unit
  (** Cancels the current macro if recording one. *)

val count : 'a t -> int React.signal
  (** The number of actions in the macro recorder. It is [0] if the
      recorder is not currently recording. *)

val get_count : 'a t -> int
  (** Returns the current number of actions in the macro recorder. *)

val add : 'a t -> 'a -> unit
  (** [add recorder x] adds [x] to the recorder if it is recording a
      macro. *)

val contents : 'a t -> 'a list
  (** Returns the currently recorded macro. *)

val counter : 'a t -> int React.signal
  (** The contents of the macro counter. *)

val get_counter : 'a t -> int
  (** Gets the contents of the macro counter. *)

val set_counter : 'a t -> int -> unit
  (** Sets the macro counter to the given value. *)

val add_counter : 'a t -> int -> unit
  (** Adds the given value to the macro counter. *)