Source refactoing after code review;
Some checks failed
CI Code / Check spelling (pull_request) Successful in 20s
CI Code / Check coding style (pull_request) Failing after 36s
CI Code / Linux (ubuntu) (pull_request) Successful in 15m49s
CI Code / Linux (debian) (pull_request) Successful in 18m22s
CI Code / Linux (arch) (pull_request) Failing after 42s

This commit is contained in:
2025-10-29 17:45:43 +03:00
parent 68e214f27f
commit a0e3f80efa

View File

@@ -705,6 +705,7 @@ win_page_down(ProfWin* window, int scroll_size)
int* page_start = &(window->layout->y_pos);
int page_space = getmaxy(stdscr) - 4;
int page_start_initial = *page_start;
if (scroll_size == 0)
scroll_size = page_space;
win_scroll_state_t* scroll_state = &window->scroll_state;
@@ -713,7 +714,11 @@ win_page_down(ProfWin* window, int scroll_size)
*page_start += scroll_size;
// Scrolled down after reaching the bottom of the page
if (((*page_start > total_rows_with_unreaded - page_space) || ((*page_start == total_rows_with_unreaded) && (*page_start >= total_rows_with_unreaded))) && window->type == WIN_CHAT) {
gboolean past_bottom = *page_start > total_rows_with_unreaded - page_space;
gboolean at_page_space_and_past_unread = (*page_start == page_space && *page_start >= total_rows_with_unreaded);
gboolean is_chat = window->type == WIN_CHAT;
if ((past_bottom || at_page_space_and_past_unread) && is_chat) {
int bf_size = buffer_size(window->layout->buffer);
if (bf_size > 0 && *scroll_state != WIN_SCROLL_REACHED_BOTTOM) {
// How many lines are left until end of the screen