aboutsummaryrefslogtreecommitdiff
path: root/main.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2016-11-21 17:06:19 +0100
committerSébastien Dailly <sebastien@chimrod.com>2017-01-01 13:30:43 +0100
commit023c11470e32744a43b7e3c7c248f3c47ebdc687 (patch)
tree832e04c2923295d5adf61e58d9a333afb5b26c77 /main.ml
parentef312564ca84a2b49fc291434d8fb2f8501bb618 (diff)
Use gadt for function catalog
Diffstat (limited to 'main.ml')
-rwxr-xr-xmain.ml12
1 files changed, 6 insertions, 6 deletions
diff --git a/main.ml b/main.ml
index 58cbea5..393d4fe 100755
--- a/main.ml
+++ b/main.ml
@@ -97,7 +97,7 @@ let rec normal_mode (t, screen) = begin
let position = Selection.extract t.Sheet.selected in
let expr = Sheet.Raw.get_expr position t.Sheet.data
|> Expression.show in
- begin match Screen.editor ~position ~init:expr screen with
+ begin match Screen.editor ~position ~prefix:(u"-> ") ~init:expr screen with
| None ->
(* Restore the previous value *)
Screen.status screen expr;
@@ -127,7 +127,7 @@ let rec normal_mode (t, screen) = begin
| Actions.Search ->
let expr = Screen.search screen
|> Expression.load in
- let pattern = Expression.eval expr (fun _ -> ScTypes.Undefined) in
+ let pattern = Expression.eval expr (fun _ -> ScTypes.Refs.Single ScTypes.Undefined) in
begin match Sheet.search (`Pattern pattern) t with
| Some t' -> normal_mode @@ redraw t' screen
| None -> normal_mode (t, screen)
@@ -155,7 +155,7 @@ let rec normal_mode (t, screen) = begin
end
| Actions.Command ->
- begin match Screen.editor ~init:(u":") screen with
+ begin match Screen.editor ~prefix:(u":") screen with
| None ->
normal_mode (t, screen)
| Some content ->
@@ -212,13 +212,13 @@ end
and command (t, screen) action = begin
match action with
- | (":w", file) -> (* Save the file *)
+ | ("w", file) -> (* Save the file *)
Odf.save t.Sheet.data file;
normal_mode @@ redraw t screen
- | (":enew", _) -> (* Start a new spreadsheet *)
+ | ("enew", _) -> (* Start a new spreadsheet *)
let sheet = Sheet.Raw.create in
normal_mode @@ redraw (Sheet.create sheet) screen
- | (":q", _) -> (* Quit *)
+ | ("q", _) -> (* Quit *)
t
| _ -> normal_mode @@ redraw t screen
end