aboutsummaryrefslogtreecommitdiff
path: root/TUI/module.jai
diff options
context:
space:
mode:
Diffstat (limited to 'TUI/module.jai')
-rw-r--r--TUI/module.jai8
1 files changed, 5 insertions, 3 deletions
diff --git a/TUI/module.jai b/TUI/module.jai
index 5157ba2..c8a5512 100644
--- a/TUI/module.jai
+++ b/TUI/module.jai
@@ -335,11 +335,12 @@ get_terminal_size :: () -> rows: int, columns: int {
}
// Discard tail noise.
- while input.count >= 2 && input[input.count-1] != FORMAT[FORMAT.count-1] {
+ while input.count >= 3 && input[input.count-1] != FORMAT[FORMAT.count-1] {
input.count -= 1;
}
- assert(input[0] == FORMAT[0] && input[1] == FORMAT[1] && input[2] == FORMAT[2] && input[input.count-1] == FORMAT[FORMAT.count-1],
+ assert(input.count >= 3 &&
+ input[0] == FORMAT[0] && input[1] == FORMAT[1] && input[2] == FORMAT[2] && input[input.count-1] == FORMAT[FORMAT.count-1],
"Query window size in chars returned invalid response.");
parts := split(input, ";");
@@ -379,7 +380,8 @@ get_cursor_position :: () -> row: int, column: int {
input.count -= 1;
}
- assert(input[0] == FORMAT[0] && input[1] == FORMAT[1] && input[input.count-1] == FORMAT[FORMAT.count-1],
+ assert(input.count >= 2 &&
+ input[0] == FORMAT[0] && input[1] == FORMAT[1] && input[input.count-1] == FORMAT[FORMAT.count-1],
"Query cursor position returned invalid response.");