diff options
| author | dam <dam@gudinoff> | 2024-05-06 12:50:22 +0100 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2024-05-06 12:50:22 +0100 |
| commit | 65227c476071914b82720084a2a775b44e4de885 (patch) | |
| tree | 0da084871d51d1e1f092c4ce4e515aab630633d6 /modules/TUI/module.jai | |
| parent | f024b0afab602df742284b86396325ce93ce6d98 (diff) | |
| download | task-time-tracker-65227c476071914b82720084a2a775b44e4de885.tar.zst task-time-tracker-65227c476071914b82720084a2a775b44e4de885.zip | |
Cleanup UTF helper.
Diffstat (limited to 'modules/TUI/module.jai')
| -rw-r--r-- | modules/TUI/module.jai | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/TUI/module.jai b/modules/TUI/module.jai index e25672f..7c3a71d 100644 --- a/modules/TUI/module.jai +++ b/modules/TUI/module.jai @@ -398,7 +398,7 @@ get_key :: (timeout_milliseconds: s32 = -1) -> Key { // By default, parse a single UTF8 character (1 to 4 bytes). to_parse := input_string; - to_parse.count = count_utf8_bytes(input_string[0]); + to_parse.count = count_character_bytes(input_string[0]); defer advance(*input_string, to_parse.count); // Advance over parsed input. // Try to parse escape code. @@ -555,7 +555,7 @@ read_input_line :: (count_limit: int, is_visible: bool = true) -> string, Key { case; if is_escape_code(key) continue; - buff_idx := map_character_to_buffer_idx(str, idx); + buff_idx := get_byte_idx(str, idx); key_str := to_string(key,, allocator = temporary_allocator); // Make sure we have space to append the new character at the end (in case we're trying to do it). @@ -572,7 +572,7 @@ read_input_line :: (count_limit: int, is_visible: bool = true) -> string, Key { idx += 1; // Truncate string to avoid incomplete utf8 codes on the string tail. - str.count = truncate_string(str, count_limit); + truncate(*str, count_limit); } } |
