Skip to content

Commit

Permalink
Switch from camomile to uu*
Browse files Browse the repository at this point in the history
Co-authored-by: Jonah Beckford <[email protected]>
Co-authored-by: ZAN DoYe <[email protected]>
Co-authored-by: Nicolás Ojeda Bär <[email protected]>
  • Loading branch information
4 people committed Jul 4, 2022
1 parent a550614 commit 8d323b2
Show file tree
Hide file tree
Showing 29 changed files with 363 additions and 451 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------

* Replace Camomile with uu* (Nicolás Ojeda Bär, ZAN DoYe, Thibaut Mattio, Jonah Beckford, #109)

3.2.0 (2022-02-21)
------------------

Expand Down
6 changes: 2 additions & 4 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ facilities in console applications.")
(depends
(ocaml
(>= 4.08.0))
(camomile
(>= 1.0.1))
(lwt
(>= 4.2.0))
lwt_log
Expand All @@ -41,5 +39,5 @@ facilities in console applications.")
react
(zed
(and
(>= 3.1.0)
(< 3.2.0)))))
(>= 3.2.0)
(< 4.0)))))
9 changes: 4 additions & 5 deletions examples/asciiart/asciiart.ml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ let indices img =
open Lwt
open LTerm_widget
open LTerm_geom
open CamomileLibrary

(* scrollable asciiart widget *)
class asciiart img = object(self)
Expand Down Expand Up @@ -126,19 +125,19 @@ class asciiart img = object(self)

(* adjust scale, which changes the document size *)
method private scale_event = function
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = UChar.of_char 'w' ->
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = Uchar.of_char 'w' ->
avg_rows := max 1 (!avg_rows - 1);
vscroll#set_document_size self#document_size.rows;
self#queue_draw; true
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = UChar.of_char 's' ->
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = Uchar.of_char 's' ->
avg_rows := !avg_rows + 1;
vscroll#set_document_size self#document_size.rows;
self#queue_draw; true
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = UChar.of_char 'a' ->
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = Uchar.of_char 'a' ->
avg_cols := max 1 (!avg_cols - 1);
hscroll#set_document_size self#document_size.cols;
self#queue_draw; true
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = UChar.of_char 'd' ->
| LTerm_event.Key{LTerm_key.code=LTerm_key.Char c;_} when c = Uchar.of_char 'd' ->
avg_cols := !avg_cols + 1;
hscroll#set_document_size self#document_size.cols;
self#queue_draw; true
Expand Down
2 changes: 1 addition & 1 deletion examples/double_editor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let ( >>= ) = Lwt.( >>= )
let make_key ?(ctrl = false) ?(meta = false) ?(shift = false) c =
let code =
match c with
| `Char c -> LTerm_key.Char (CamomileLibrary.UChar.of_char c)
| `Char c -> LTerm_key.Char (Uchar.of_char c)
| `Other key -> key in
{ LTerm_key.control = ctrl; meta; shift; code }

Expand Down
5 changes: 2 additions & 3 deletions examples/editor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* This file is a part of Lambda-Term.
*)

open CamomileLibraryDefault.Camomile
open Lwt

let main () =
Expand All @@ -25,9 +24,9 @@ let main () =
editor#bind
(let open LTerm_key in
[ { control = true; meta = false; shift = false
; code = Char (UChar.of_char 'x') }
; code = Char (Uchar.of_char 'x') }
; { control = true; meta = false; shift = false
; code = Char (UChar.of_char 'c') }
; code = Char (Uchar.of_char 'c') }
])
[ LTerm_edit.Custom (fun () -> wakeup wakener ()) ];

Expand Down
2 changes: 1 addition & 1 deletion examples/read_yes_no.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ open Lwt

let rec read_char term =
LTerm.read_event term >>= function
| LTerm_event.Key { LTerm_key.code = LTerm_key.Char ch; LTerm_key.control = true ; _ } when ch = CamomileLibraryDefault.Camomile.UChar.of_char 'c' ->
| LTerm_event.Key { LTerm_key.code = LTerm_key.Char ch; LTerm_key.control = true ; _ } when ch = Uchar.of_char 'c' ->
(* Exit on Ctrl+C *)
Lwt.fail (Failure "interrupted")
| LTerm_event.Key { LTerm_key.code = LTerm_key.Char ch ; _ } ->
Expand Down
3 changes: 1 addition & 2 deletions examples/shell.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

(* A mini shell *)

open CamomileLibraryDefault.Camomile
open React
open Lwt
open LTerm_style
Expand Down Expand Up @@ -67,7 +66,7 @@ let make_prompt size exit_code time =
S" >─";
S(Zed_utf8.make
(size.cols - 24 - Zed_utf8.length code - Zed_utf8.length path)
(UChar.of_int 0x2500));
(Uchar.of_int 0x2500));
S"[ ";
B_fg(if exit_code = 0 then lwhite else lred); S code; E_fg;
S" ]─";
Expand Down
3 changes: 1 addition & 2 deletions lambda-term.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ bug-reports: "https://github.com/ocaml-community/lambda-term/issues"
depends: [
"dune" {>= "3.0"}
"ocaml" {>= "4.08.0"}
"camomile" {>= "1.0.1"}
"lwt" {>= "4.2.0"}
"lwt_log"
"lwt_react"
"mew_vi" {>= "0.5.0" & < "0.6.0"}
"react"
"zed" {>= "3.1.0" & < "3.2.0"}
"zed" {>= "3.2.0" & < "4.0"}
"odoc" {with-doc}
]
build: [
Expand Down
2 changes: 1 addition & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(name lambda_term)
(public_name lambda-term)
(wrapped false)
(libraries camomile lwt lwt.unix lwt_react zed lwt_log mew_vi)
(libraries lwt lwt.unix lwt_react zed lwt_log mew_vi uucp)
(flags (:standard -safe-string))
(synopsis "Cross-platform library for terminal manipulation")
(c_library_flags (:standard (:include c_library_flags)))
Expand Down
Loading

0 comments on commit 8d323b2

Please sign in to comment.