--- src/gufoConsole.ml.orig 2020-03-29 00:19:15.000000000 +0800 +++ src/gufoConsole.ml 2025-10-18 13:18:37.000000000 +0800 @@ -26,7 +26,6 @@ open GenUtils open GufoParsed open GufoExpression -open CamomileLibrary open React open Lwt open LTerm_style @@ -329,7 +328,7 @@ ) in let print_curword word = - (match UChar.uint_code (UTF8.get word 0) with + (match Uchar.to_int (Zed_utf8.get word 0) with | 0x0024 (*$*) -> (*TODO : it could be a module *) (*word is a var, we try to deduce its type *) @@ -414,9 +413,9 @@ let colorize new_char (acc,curword,in_quote,in_comment) = (match in_comment,in_quote with | true,_-> - [ S (sprintf "%s%c" curword (UChar.char_of new_char) );B_fg c_comment] @ acc, "",false,true + [ S (sprintf "%s%c" curword (Char.chr (Uchar.to_int new_char)) );B_fg c_comment] @ acc, "",false,true | _,false -> - (match UChar.uint_code new_char with + (match Uchar.to_int new_char with | 0x000D (* newline *) | 0x000A (* newline *) | 0x0028 (* ( *) @@ -425,15 +424,15 @@ let acc = if String.length curword > 0 then print_curword curword @ acc else acc in - [ S (sprintf "%c" (UChar.char_of new_char) );B_fg c_unknown] @ acc , "", false,false + [ S (sprintf "%c" (Char.chr (Uchar.to_int new_char)) );B_fg c_unknown] @ acc , "", false,false | 0x0022 -> (* quote symbol *) let acc = if String.length curword > 0 then print_curword curword @ acc else acc in - [ S (sprintf "%c" (UChar.char_of new_char) ); B_fg c_string] @ acc , "",true,false + [ S (sprintf "%c" (Char.chr (Uchar.to_int new_char)) ); B_fg c_string] @ acc , "",true,false | 0x0023 -> (* comment symbol *) - [ S (sprintf "%c" (UChar.char_of new_char) ); B_fg c_comment] @ acc , "",false,true + [ S (sprintf "%c" (Char.chr (Uchar.to_int new_char)) ); B_fg c_comment] @ acc , "",false,true (* | 0x002B (* + symbol *) | 0x002D (* - symbol *) @@ -445,14 +444,14 @@ [ S (sprintf "%c" (UChar.char_of new_char) );B_fg c_keyword] @ acc , "", false,false *) | _ -> - acc, sprintf "%s%s" curword (UTF8.init 1 (fun _ -> new_char) ), false,false + acc, sprintf "%s%s" curword (Zed_utf8.init 1 (fun _ -> new_char) ), false,false ) | _,true -> (*in a string*) - (match UChar.uint_code new_char with + (match Uchar.to_int new_char with | 0x0022 -> (* quote symbol *) - [ S (sprintf "%s%c" curword (UChar.char_of new_char) );B_fg c_string] @ acc, "",false,false + [ S (sprintf "%s%c" curword (Char.chr (Uchar.to_int new_char)) );B_fg c_string] @ acc, "",false,false | _ -> - acc, (sprintf "%s%s" curword (UTF8.init 1 (fun _ -> new_char) )), true , false + acc, (sprintf "%s%s" curword (Zed_utf8.init 1 (fun _ -> new_char) )), true , false ) ) in @@ -635,7 +634,7 @@ (fun () -> let expr = match akey.code with - | Char i ->insert_in_expr cur_expr (Zed_char.unsafe_of_uChar i) + | Char i -> insert_in_expr cur_expr (Zed_char.unsafe_of_uChar i) | _ -> assert false in analyse_and_print term cur_expr >>= @@ -644,7 +643,7 @@ | Some search_expr -> (*search mod*) let search_expr = match akey.code with - | Char i ->sprintf "%s%c" search_expr (UChar.char_of i) + | Char i -> sprintf "%s%c" search_expr (Char.chr (Uchar.to_int i)) | _ -> assert false in let new_expr = find_hist_expr cur_expr hist search_expr in @@ -885,17 +884,17 @@ let handle_key_event term shell_env hist cur_expr akey = try (match akey.LTerm_key.code with - | Char uchar when ((UChar.uint_code uchar) = 0x0068 && akey.LTerm_key.control) + | Char uchar when ((Uchar.to_int uchar) = 0x0068 && akey.LTerm_key.control) (*It looks some conventions allows CTRL-H to del char, and some GUI Terms * remap backspace to CTRL-H... * https://github.com/diml/lambda-term/issues/57 * *) -> delete term shell_env hist cur_expr - | Char uchar when ((UChar.uint_code uchar) = 0x0020) && + | Char uchar when ((Uchar.to_int uchar) = 0x0020) && (akey.LTerm_key.control) -> (multiline_expr term shell_env hist cur_expr) - | Char uchar when ((UChar.uint_code uchar) = 0x0072) && (*CTRL-R*) + | Char uchar when ((Uchar.to_int uchar) = 0x0072) && (*CTRL-R*) (akey.LTerm_key.control) -> (search_hist term shell_env hist cur_expr)