take height into account

This commit is contained in:
Zvonimir Rudinski
2024-06-02 06:50:19 +02:00
parent 90991e7401
commit 705f989737

6
main.c
View File

@@ -228,10 +228,10 @@ void add_command_handler(int width, int height) {
arrput(todos, item); arrput(todos, item);
} }
void view_command_handler(int width, int index) { void view_command_handler(int width, int height, int index) {
TodoItem item = todos[index]; TodoItem item = todos[index];
// create an alert in the middle of the screen // create an alert in the middle of the screen
alert(item.title, width, 24); alert(item.title, width, height);
} }
void mark_command_handler(int index) { void mark_command_handler(int index) {
@@ -362,7 +362,7 @@ int main(int argc, char **argv) {
add_command_handler(terminal_width, terminal_height); add_command_handler(terminal_width, terminal_height);
break; break;
case VIEW: case VIEW:
view_command_handler(terminal_width, current_line); view_command_handler(terminal_width, terminal_height, current_line);
break; break;
case MARK: case MARK:
case SPACE: case SPACE: