Skip to content

Commit 283fafe

Browse files
committedMay 14, 2019
follow the api changes of Zed_char and Zed_string
1 parent 36a848b commit 283fafe

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed
 

‎src/lTerm.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ let render_style term buf old_point new_point =
11641164
let render_point term buf old_point new_point =
11651165
render_style term buf old_point new_point;
11661166
(* Skip control characters, otherwise output will be messy. *)
1167-
if UChar.code new_point.LTerm_draw.char.core < 32 then
1167+
if UChar.code (Zed_char.core new_point.LTerm_draw.char) < 32 then
11681168
Buffer.add_string buf unknown_utf8
11691169
else
11701170
Buffer.add_string buf (Zed_char_UTF8.of_t new_point.LTerm_draw.char)
@@ -1244,7 +1244,7 @@ let render_windows term kind handle_newlines matrix =
12441244
else begin
12451245
match !(Array.unsafe_get line i) with
12461246
| LTerm_draw.Elem point->
1247-
let code = UChar.code point.LTerm_draw.char.core in
1247+
let code = UChar.code (Zed_char.core point.LTerm_draw.char) in
12481248
if handle_newlines && code = 10 then begin
12491249
(* Copy styles. *)
12501250
Array.unsafe_set res i (windows_char_info term point yspace);
@@ -1345,7 +1345,7 @@ let print_box_with_newlines_unix term matrix =
13451345
let rec loop x =
13461346
match !(Array.unsafe_get line x) with
13471347
| Elem point->
1348-
let code = UChar.code point.char.core in
1348+
let code = UChar.code (Zed_char.core point.char) in
13491349
if x = cols then begin
13501350
if code = 10 && y < rows - 1 then
13511351
Buffer.add_char buf '\n'

‎src/lTerm_buttons_impl.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(*
2-
* lTerm.ml
3-
* --------
2+
* lTerm_buttons_impl.ml
3+
* ---------------------
44
* Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
55
* Licence : BSD3
66
*

‎src/lTerm_draw.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ let char_of_piece = function
597597

598598
let piece_of_point point=
599599
match !point with
600-
| Elem elem-> piece_of_char elem.char.core
600+
| Elem elem-> piece_of_char (Zed_char.core elem.char)
601601
| WidthHolder _-> None
602602

603603
let draw_piece ctx row col ?style piece=

‎src/lTerm_text_impl.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Make (LiteralIntf: LiteralIntf.Type) = struct
2020
let dummy = (Zed_char.unsafe_of_char ' ', LTerm_style.none)
2121

2222
let of_string str=
23-
Array.map (fun chr-> (chr, LTerm_style.none)) str.Zed_string.chars
23+
Array.map (fun chr-> (chr, LTerm_style.none)) (Zed_string.chars str)
2424

2525
let aval_width= function
2626
| Ok Zed_string.{len=_;width}-> width
@@ -54,7 +54,7 @@ module Make (LiteralIntf: LiteralIntf.Type) = struct
5454
let chr= Zed_string.get str idx in
5555
match Zed_char.prop chr with
5656
| Other->
57-
let code= UChar.int_of (Zed_string.get str idx).core in
57+
let code= UChar.int_of (Zed_char.core (Zed_string.get str idx)) in
5858
Array.unsafe_set arr (idx + 0)
5959
(Zed_char.unsafe_of_char '\\', LTerm_style.none);
6060
Array.unsafe_set arr (idx + 1)
@@ -102,7 +102,7 @@ module Make (LiteralIntf: LiteralIntf.Type) = struct
102102

103103
let stylise str style =
104104
let str= Zed_string_UTF8.to_t_exn str in
105-
Array.map (fun chr-> (chr, style)) str.chars
105+
Array.map (fun chr-> (chr, style)) (Zed_string.chars str)
106106

107107
(* +-----------------------------------------------------------------+
108108
| Parenthesis matching |

0 commit comments

Comments
 (0)
Please sign in to comment.