diff options
author | cflip <cflip@cflip.net> | 2023-01-17 20:52:18 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-17 20:52:18 -0700 |
commit | a40638b63deeb27301d56db7426fba56850927ca (patch) | |
tree | 972cf764e62eb1d3f13d35445ca5a693e3e08203 /editor.c | |
parent | 1a416a917d74d956469e6e80cf4bb519e9474c91 (diff) |
Allow window to be resizable
Diffstat (limited to 'editor.c')
-rw-r--r-- | editor.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -27,9 +27,7 @@ void init_editor(struct editor_state* editor) editor->syntax = NULL; editor->mode = EDITOR_MODE_NORMAL; - window_get_size(&editor->screen_rows, &editor->screen_cols); - - editor->screen_rows -= 2; + editor_update_screen_size(editor); } void editor_set_status_message(struct editor_state* editor, const char* format, ...) @@ -255,6 +253,12 @@ void editor_scroll(struct editor_state* editor) editor->col_offset = editor->cursor_display_x - editor->screen_cols + 1; } +void editor_update_screen_size(struct editor_state *editor) +{ + window_get_size(&editor->screen_rows, &editor->screen_cols); + editor->screen_rows -= 2; +} + void editor_draw_rows(struct editor_state* editor, struct append_buffer* buffer) { int y; |