fix: Increase scrollback buffer height for chat rendering (PAD_SIZE)

f27fa98 commit introduced issue of scrolling seemingly randomly being stuck and the following message flood in the logs: "WRN: Ncurses Overflow..."

A pad is an off-screen buffer — larger than the visible terminal screen — that you can scroll, render parts of, or update selectively.

Unlike regular windows, a pad is not tied to screen size. You can create a pad that's 1,000 lines tall, even if your terminal is only 40 lines tall.

This commit addresses the issue by increasing PAD_SIZE to a reasonable number,
allowing messages from buffer to be displayed without overflowing NCurses' window size (maxy).

Minor change: add .cache folder to gitignore
This commit is contained in:
2025-07-01 16:42:03 +02:00
parent 43bab6ff8f
commit 6a394ae2e5
3 changed files with 6 additions and 1 deletions

3
.gitignore vendored
View File

@@ -44,6 +44,9 @@ src/gitversion.h.in
src/stamp-h1
src/plugins/profapi.lo
# clangd
.cache/
# out-of-tree build folders
build*/

View File

@@ -62,7 +62,6 @@
#include "xmpp/xmpp.h"
#include "xmpp/roster_list.h"
static const int PAD_SIZE = 100;
static const char* LOADING_MESSAGE = "Loading older messages…";
static const char* CONS_WIN_TITLE = "Profanity. Type /help for help information.";
static const char* XML_WIN_TITLE = "XML Console";

View File

@@ -56,6 +56,9 @@
#include "xmpp/contact.h"
#include "xmpp/muc.h"
// Max lines per window rendered by NCurses
static const int PAD_SIZE = 10000;
void win_move_to_end(ProfWin* window);
void win_show_status_string(ProfWin* window, const char* const from,
const char* const show, const char* const status,