diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 18:27:07 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 18:27:07 -0500 |
commit | 2baf965c7db4a3640cd120e050c61aa7de67448b (patch) | |
tree | 4ea6d87d6157b3d25eba24aa8805a10219c44a2f /buffer.c | |
parent | 3ff107c7ca438749a8425feef9eefb67c7a8abfc (diff) |
node resizing working
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -844,6 +844,9 @@ void buffer_scroll_to_pos(TextBuffer *buffer, BufferPos pos) { double display_cols = buffer_display_cols(buffer); double scroll_x = buffer->scroll_x, scroll_y = buffer->scroll_y; double scrolloff = settings->scrolloff; + + // for very small buffers, the scrolloff might need to be reduced. + scrolloff = mind(scrolloff, display_lines * 0.5); // scroll left if pos is off screen in that direction double max_scroll_x = col - scrolloff; @@ -2073,6 +2076,7 @@ void buffer_render(TextBuffer *buffer, Rect r) { // set x1,y1,x2,y2 to an size 0 rectangle buffer->x1 = buffer->x2 = r.pos.x; buffer->y1 = buffer->y2 = r.pos.y; + return; } float x1, y1, x2, y2; |