From 51dc6ba469cf4e05496665c6a957cf4d5a5f9bf9 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Sun, 6 Mar 2022 12:30:56 +0100 Subject: [PATCH] scrollback: do not scroll up when already at the top ref. #57 --- patch/scrollback.c | 5 +++++ patches.def.h | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/patch/scrollback.c b/patch/scrollback.c index e97f21b..3dfae84 100644 --- a/patch/scrollback.c +++ b/patch/scrollback.c @@ -26,6 +26,11 @@ kscrollup(const Arg* a) int n = a->i; if (n < 0) n = term.row + n; + if (term.scr + n > term.histi) + n = term.histi - term.scr; + + if (!n) + return; if (term.scr <= HISTSIZE-n) { term.scr += n; diff --git a/patches.def.h b/patches.def.h index 8a255dd..d880242 100644 --- a/patches.def.h +++ b/patches.def.h @@ -288,13 +288,9 @@ * not specific to this variant of st - the same issue is present in * the xterm implementation. This is likely an issue of sixel height * not being detected correctly. - * - If combined with the alpha patch sixel graphics disappear (become white) - * when transparent and rendered against a white background. This is believed - * to be related to how the sixel graphics use RGB colors instead of RGBA. - * A pull request or instructions for how to properly add alpha support for - * sixel graphics would be very welcome. * * Note that you need to uncomment the corresponding lines in config.mk when including this patch. + * This patch is incompatible with the W3M patch. * * https://gist.github.com/saitoha/70e0fdf22e3e8f63ce937c7f7da71809 */