From: Christian Heller Date: Fri, 28 Jun 2013 20:43:32 +0000 (+0200) Subject: If pad ends leftwards of current right screen border, allow pad scrolling to the... X-Git-Tag: tce~1181 X-Git-Url: https://plomlompom.com/repos/te"st.html?a=commitdiff_plain;h=b9c8ecb28dfe7c2bf7bf25761713a35e4a97b49f;p=plomrogue If pad ends leftwards of current right screen border, allow pad scrolling to the left, but not to the right. --- diff --git a/src/windows.c b/src/windows.c index 181247c..33b9b31 100644 --- a/src/windows.c +++ b/src/windows.c @@ -295,5 +295,6 @@ extern void shift_active_win (struct WinMeta * wmeta, char dir) { extern void reset_pad_offset(struct WinMeta * wmeta, uint16_t new_offset) { // Apply new_offset to windows pad, if it proves to be sane. - if (new_offset >= 0 && new_offset + wmeta->pad.size.x < getmaxx(wmeta->pad.curses_win)) + if (new_offset >= 0 + && (new_offset < wmeta->pad_offset || new_offset + wmeta->pad.size.x < getmaxx(wmeta->pad.curses_win))) wmeta->pad_offset = new_offset; }