Skip to content

Commit 2569162

Browse files
emillonkit-ty-kate
authored andcommitted
Compatibility with zed 3.2.0
This updates utop to use the uu packages instead of camomile, following ocaml-community/zed#46 and ocaml-community/lambda-term#109.
1 parent a0f19fd commit 2569162

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/lib/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
(wrapped false)
55
(flags :standard -safe-string)
66
(modes byte)
7-
(libraries compiler-libs.toplevel findlib.top lambda-term threads)
7+
(libraries compiler-libs.toplevel findlib.top lambda-term threads zed)
88
(preprocess
99
(action
1010
(run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file}))))

src/lib/uTop.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
[@@@warning "-27"]
1111

12-
open CamomileLibraryDefault.Camomile
1312
open Lwt_react
1413
open LTerm_text
1514
open LTerm_geom
@@ -477,7 +476,7 @@ let make_prompt ui profile count size key_sequence (recording, macro_count, macr
477476
txta;
478477
Array.make
479478
(size.cols - Array.length txta - Array.length txtb)
480-
(Zed_char.unsafe_of_uChar (UChar.of_int 0x2500), { none with foreground = Some (color lcyan blue); bold = Some bold });
479+
(Zed_char.of_utf8 "\u{2500}", { none with foreground = Some (color lcyan blue); bold = Some bold });
481480
txtb;
482481
]
483482
) second_line

src/lib/uTop_main.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
[@@@warning "-7-9-27-32-33"]
1111

12-
open CamomileLibraryDefault.Camomile
1312
open Lwt_react
1413
open LTerm_dlist
1514
open LTerm_text
@@ -256,7 +255,7 @@ class read_phrase ~term = object(self)
256255
return (LTerm_read_line.Result result)
257256
with UTop.Need_more ->
258257
(* Input not finished, continue. *)
259-
self#insert (UChar.of_char '\n');
258+
self#insert (Uchar.of_char '\n');
260259
self#exec ~keys actions
261260
end
262261
| actions ->
@@ -328,7 +327,7 @@ let fix_string str =
328327
let buf = Buffer.create (len + 128) in
329328
if ofs > 0 then Buffer.add_substring buf str 0 ofs;
330329
let rec loop ofs =
331-
Zed_utf8.add buf (UChar.of_char str.[ofs]);
330+
Zed_utf8.add buf (Uchar.of_char str.[ofs]);
332331
let ofs1 = ofs + 1 in
333332
let ofs2, _, _ = Zed_utf8.next_error str ofs1 in
334333
if ofs1 < ofs2 then

utop.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ depends: [
1313
"lambda-term" {>= "3.1.0" & < "4.0"}
1414
"lwt"
1515
"lwt_react"
16-
"camomile"
16+
"zed" { >= "3.2.0" }
1717
"react" {>= "1.0.0"}
1818
"cppo" {build & >= "1.1.2"}
1919
"dune" {>= "1.0"}

0 commit comments

Comments
 (0)