package lambda-term

  1. Overview
  2. Docs
Module type
Class type

The read-line engine. If no clipboard is provided, LTerm_edit.clipboard is used. If no macro recorder is provided, macro is used.

method virtual eval : 'a

Evaluates the contents of the engine.

method insert : Stdlib.Uchar.t -> unit

Inserts the given character. Note that is it also possible to manipulate directly the edition context.

method send_action : action -> unit

Evolves according to the given action.

method edit : unit Zed_edit.t

The edition engine used by this read-line engine.

method context : unit Zed_edit.context

The context for the edition engine.

method clipboard : Zed_edit.clipboard

The clipboard used by the edition engine.

method macro : action Zed_macro.t

The macro recorder.

method input_prev : Zed_rope.t

The input before the cursor.

method input_next : Zed_rope.t

The input after the cursor.

method mode : mode React.signal

The current mode.

method stylise : bool -> LTerm_text.t * int

Returns the stylised input and the position of the cursor. The argument is true if this is for the last drawing or false otherwise.

method history : (Zed_string.t list * Zed_string.t list) React.signal

The history zipper.

method message : LTerm_text.t option React.signal

A message to display in the completion box. When None the completion should be displayed, and when Some msg msg should be displayed.

method interrupt : exn Lwt_mvar.t

To notify an interrupt singal

method completion_words : (Zed_string.t * Zed_string.t) list React.signal

Current possible completions. Each completion is of the form (word, suffix) where word is the completion itself and suffix is a suffix to add if the completion is choosen.

method completion_index : int React.signal

The position in the completion bar.

method set_completion : ?index:int -> int -> (Zed_string.t * Zed_string.t) list -> unit

set_completion ?index start words sets the current completions. start is the position of the beginning of the word being completed and words is the list of possible completions with their suffixes. index is the position in the completion bar, default to 0. The result is made available through the completion_words signal.

method completion : unit

Ask for computing completion for current input. This method should call set_completion.

method complete : unit

Complete current input. This is the method called when the user presses Tab.

method show_box : bool

Whether to show the box or not. It default to true.


Innovation. Community. Security.