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:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -44,6 +44,9 @@ src/gitversion.h.in
|
|||||||
src/stamp-h1
|
src/stamp-h1
|
||||||
src/plugins/profapi.lo
|
src/plugins/profapi.lo
|
||||||
|
|
||||||
|
# clangd
|
||||||
|
.cache/
|
||||||
|
|
||||||
# out-of-tree build folders
|
# out-of-tree build folders
|
||||||
build*/
|
build*/
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
#include "xmpp/xmpp.h"
|
#include "xmpp/xmpp.h"
|
||||||
#include "xmpp/roster_list.h"
|
#include "xmpp/roster_list.h"
|
||||||
|
|
||||||
static const int PAD_SIZE = 100;
|
|
||||||
static const char* LOADING_MESSAGE = "Loading older messages…";
|
static const char* LOADING_MESSAGE = "Loading older messages…";
|
||||||
static const char* CONS_WIN_TITLE = "Profanity. Type /help for help information.";
|
static const char* CONS_WIN_TITLE = "Profanity. Type /help for help information.";
|
||||||
static const char* XML_WIN_TITLE = "XML Console";
|
static const char* XML_WIN_TITLE = "XML Console";
|
||||||
|
|||||||
@@ -56,6 +56,9 @@
|
|||||||
#include "xmpp/contact.h"
|
#include "xmpp/contact.h"
|
||||||
#include "xmpp/muc.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_move_to_end(ProfWin* window);
|
||||||
void win_show_status_string(ProfWin* window, const char* const from,
|
void win_show_status_string(ProfWin* window, const char* const from,
|
||||||
const char* const show, const char* const status,
|
const char* const show, const char* const status,
|
||||||
|
|||||||
Reference in New Issue
Block a user