diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-29 23:02:42 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-29 23:02:42 -0500 |
commit | 642b09558e586d47f172fcfd18c296d400317708 (patch) | |
tree | 796666be6c3721a3c70dad66bd94c902b297e8ab /buffer.c | |
parent | 51837743b0f90973bf63582a8f34662e9677629e (diff) |
started config file
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -542,7 +542,7 @@ Status buffer_load_file(TextBuffer *buffer, char const *filename) { } } -Status buffer_save(TextBuffer *buffer) { +bool buffer_save(TextBuffer *buffer) { FILE *out = fopen(buffer->filename, "wb"); if (out) { bool success = true; @@ -755,16 +755,16 @@ static void buffer_scroll_to_cursor(TextBuffer *buffer) { // scroll left if cursor is off screen in that direction double max_scroll_x = (double)(cursor_col - scroll_padding); - scroll_x = util_mind(scroll_x, max_scroll_x); + scroll_x = mind(scroll_x, max_scroll_x); // scroll right double min_scroll_x = (double)(cursor_col - display_cols + scroll_padding); - scroll_x = util_maxd(scroll_x, min_scroll_x); + scroll_x = maxd(scroll_x, min_scroll_x); // scroll up double max_scroll_y = (double)(cursor_line - scroll_padding); - scroll_y = util_mind(scroll_y, max_scroll_y); + scroll_y = mind(scroll_y, max_scroll_y); // scroll down double min_scroll_y = (double)(cursor_line - display_lines + scroll_padding); - scroll_y = util_maxd(scroll_y, min_scroll_y); + scroll_y = maxd(scroll_y, min_scroll_y); buffer->scroll_x = scroll_x; buffer->scroll_y = scroll_y; |