module Engine:sig..end
type selection_state = {
|
sel_text : |
(* |
The whole input text on which the selection is working
| *) |
|
sel_mark : |
(* |
Pointer to the mark
| *) |
|
sel_cursor : |
(* |
Pointer to the cursor
| *) |
type search_state = {
|
search_word : |
(* |
The word we are looking for
| *) |
|
search_history : |
(* |
Position in history. The first element is a sentence
containing the searched word
| *) |
|
search_init_history : |
(* |
The initial history, before searching for a word
| *) |
type mode =
| |
Edition of |
(* |
The user is typing some text
| *) |
| |
Selection of |
(* |
The user is selecting some text
| *) |
| |
Search of |
(* |
The user is searching the given word in the history
| *) |
type state = {
|
mode : |
|||
|
history : |
(* |
Cursor to the history position.
| *) |
val init : Lwt_read_line.history -> stateinit history return a initial state using the given
historyval reset : state -> statereset state reset the given state, if the user was doing a
selection, it is canceledval update : engine_state:state ->
?clipboard:Lwt_read_line.clipboard ->
command:Lwt_read_line.Command.t -> unit -> stateupdate ~state ?clipboard ~command () update an engine state by
processing the given command. It returns the new state, and
may have the side effect of changing the clipboard contents.
clipboard defaults to the global clipboard.
val edition_state : state -> Lwt_read_line.edition_stateval all_input : state -> Text.t