summaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2023-01-11 11:18:24 -0700
committercflip <cflip@cflip.net>2023-01-11 11:18:24 -0700
commit61c387397d03c479ca110a02bfa78cd39fa82656 (patch)
treec0c4a538867eef968e9c977053470999e89400bd /editor.c
parent9e6f24187ebe2577fde7c7a971a8cc408f4aeaac (diff)
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.
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c3
1 files changed, 1 insertions, 2 deletions
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;
}