fix(ui): raise pad redraw threshold above buffer cap to fix history scroll #133
@@ -43,7 +43,7 @@
|
|||||||
#include "ai/ai_client.h"
|
#include "ai/ai_client.h"
|
||||||
|
|
||||||
static const int PAD_MIN_HEIGHT = 100;
|
static const int PAD_MIN_HEIGHT = 100;
|
||||||
static const int PAD_THRESHOLD = 3000;
|
static const int PAD_THRESHOLD = 12000; // above buffer cap (~9000): reclaims dead pad space, never fires while scrolling
|
||||||
static gboolean _in_redraw = FALSE;
|
static gboolean _in_redraw = FALSE;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -2172,9 +2172,10 @@ win_redraw(ProfWin* window)
|
|||||||
unsigned int size = buffer_size(window->layout->buffer);
|
unsigned int size = buffer_size(window->layout->buffer);
|
||||||
_in_redraw = TRUE;
|
_in_redraw = TRUE;
|
||||||
|
|
||||||
// shrink pad back to minimum size and erase it
|
// size the pad to fit the whole buffer (plus headroom) and erase it
|
||||||
int cols = getmaxx(window->layout->win);
|
int cols = getmaxx(window->layout->win);
|
||||||
wresize(window->layout->win, PAD_MIN_HEIGHT, cols);
|
int needed = window->layout->buffer->lines + 100;
|
||||||
|
wresize(window->layout->win, MAX(needed, PAD_MIN_HEIGHT), cols);
|
||||||
werase(window->layout->win);
|
werase(window->layout->win);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < size; i++) {
|
for (unsigned int i = 0; i < size; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user