From 61c387397d03c479ca110a02bfa78cd39fa82656 Mon Sep 17 00:00:00 2001 From: cflip Date: Wed, 11 Jan 2023 11:18:24 -0700 Subject: Get editor size from the window instead of the terminal Previously the editor would resize itself upon startup by finding the size of the current terminal window, but now that it is running in an actual window it should get the number of rows and columns from there. This also adds parameters for the window size in rows and columns to the window_init() function. --- editor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'editor.c') diff --git a/editor.c b/editor.c index 14eada7..43a469a 100644 --- a/editor.c +++ b/editor.c @@ -28,8 +28,7 @@ void init_editor(struct editor_state* editor) editor->status_message_time = 0; editor->syntax = NULL; - if (get_window_size(&editor->screen_rows, &editor->screen_cols) == -1) - die("get_window_size"); + window_get_size(&editor->screen_rows, &editor->screen_cols); editor->screen_rows -= 2; } -- cgit v1.2.3