diff options
| author | dam <dam@gudinoff> | 2024-12-21 23:21:46 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2024-12-22 02:11:27 +0000 |
| commit | ec98642dfdf9e113702becebd8cac122ba1cc14d (patch) | |
| tree | dc10b33d92b0ad557931fa9f0b37f99b0414ad25 | |
| parent | 2ec6ef66d9fdc4f225c5f0e6317bb7ecba040533 (diff) | |
| download | task-time-tracker-ec98642dfdf9e113702becebd8cac122ba1cc14d.tar.zst task-time-tracker-ec98642dfdf9e113702becebd8cac122ba1cc14d.zip | |
Update code to comply with compiler beta 0.1.094.
| -rw-r--r-- | modules/TUI/examples/snake.jai | 2 | ||||
| -rw-r--r-- | modules/TUI/key_map.jai | 2 | ||||
| -rw-r--r-- | modules/TUI/module.jai | 2 | ||||
| -rw-r--r-- | modules/TUI/tests.jai | 9 | ||||
| -rw-r--r-- | ttt.jai | 2 |
5 files changed, 8 insertions, 9 deletions
diff --git a/modules/TUI/examples/snake.jai b/modules/TUI/examples/snake.jai index b62136c..b290d27 100644 --- a/modules/TUI/examples/snake.jai +++ b/modules/TUI/examples/snake.jai @@ -124,7 +124,7 @@ game_loop :: () { last_pos := snake_parts[snake_parts.count-1]; // Update snake position. - for < snake_parts.count-1..1 { + for #v2 < 1..snake_parts.count-1 { if snake_parts[it] != snake_parts[it-1] { snake_parts[it] = snake_parts[it-1]; } diff --git a/modules/TUI/key_map.jai b/modules/TUI/key_map.jai index 43762f4..ce31389 100644 --- a/modules/TUI/key_map.jai +++ b/modules/TUI/key_map.jai @@ -11,6 +11,8 @@ setup_key_map :: () { if key_map.count > 0 then return; + init(*key_map); + /* This table was created/tested using the following terminals: - g: gnome terminal diff --git a/modules/TUI/module.jai b/modules/TUI/module.jai index 1ed950b..13f8183 100644 --- a/modules/TUI/module.jai +++ b/modules/TUI/module.jai @@ -609,7 +609,7 @@ read_input_line :: (count_limit: int, is_visible: bool = true) -> string, Key { if buff_idx > count_limit - key_str.count then continue; // Move text to allow inserting new character. - for < count_limit-1..buff_idx + key_str.count-1 { + for #v2 < buff_idx + key_str.count-1..count_limit-1 { str.data[it] = str.data[it-key_str.count]; } diff --git a/modules/TUI/tests.jai b/modules/TUI/tests.jai index a740e6b..7e591b8 100644 --- a/modules/TUI/tests.jai +++ b/modules/TUI/tests.jai @@ -10,7 +10,7 @@ main :: () { } else { assert(TUI.reset_terminal(), "Failed to reset TUI."); - print("- ERROR: %", error_message, to_standard_error = true); + print("- ERROR: %\n", error_message, to_standard_error = true); exit(1); } } @@ -19,7 +19,7 @@ main :: () { x, y := TUI.get_cursor_position(); TUI.set_cursor_position(1, y+1); } - + if 1 { print("TEST : set and get cursor position\n", to_standard_error = true); assert(TUI.setup_terminal(), "Failed to setup TUI."); @@ -157,12 +157,9 @@ main :: () { TUI.set_cursor_position(x, y); print("size = %x%\n", width, height); key = TUI.get_key(1000); - - // __mark := get_temporary_storage_mark(); - // set_temporary_storage_mark(__mark); } - print("- success"); assert(TUI.reset_terminal(), "Failed to reset TUI."); + assert_result(true, ""); } if 1 { @@ -393,7 +393,7 @@ move_task :: (using db: *Database, source: s64, target: s64) { tasks[source + it] = tasks[source + it + 1]; } else { - for < move_size-1..0 + for #v2 < 0..move_size-1 tasks[target + it + 1] = tasks[target + it]; } |
