aboutsummaryrefslogtreecommitdiff
path: root/modules/TUI/module.jai
diff options
context:
space:
mode:
authordam <dam@gudinoff>2024-05-06 12:50:22 +0100
committerdam <dam@gudinoff>2024-05-06 12:50:22 +0100
commit65227c476071914b82720084a2a775b44e4de885 (patch)
tree0da084871d51d1e1f092c4ce4e515aab630633d6 /modules/TUI/module.jai
parentf024b0afab602df742284b86396325ce93ce6d98 (diff)
downloadtask-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.jai6
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);
}
}