summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Hindenburg <kurt.hindenburg@gmail.com>2017-07-01 19:12:39 -0400
committerSlávek Banko <slavek.banko@axis.cz>2021-02-25 01:59:16 +0100
commit429311a2ce2fd05731bfbbead50d417fdd3e0572 (patch)
treecd413139ebaa7df6a6d19eadd8922f98e6b0bee1
parent1ad768b613e2942c05448d2edddc8494a3397c2c (diff)
downloadtdebase-feat/backports-from-kde.tar.gz
tdebase-feat/backports-from-kde.zip
Konsole: Correct scrollUp behaviorfeat/backports-from-kde
CSI S escape sequence (SU, scroll up) ignored if number of lines to scroll bigger than scrollable lines REVIEW: 130133 BUG: 379318 Taken from KDE patches and adapted to TDE. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--konsole/konsole/TEScreen.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/konsole/konsole/TEScreen.cpp b/konsole/konsole/TEScreen.cpp
index 6517f2a12..1af3fa6f3 100644
--- a/konsole/konsole/TEScreen.cpp
+++ b/konsole/konsole/TEScreen.cpp
@@ -832,10 +832,22 @@ void TEScreen::scrollUp(int n)
void TEScreen::scrollUp(int from, int n)
{
- if (n <= 0 || from + n > bmargin) return;
- //FIXME: make sure `tmargin', `bmargin', `from', `n' is in bounds.
- moveImage(loc(0,from),loc(0,from+n),loc(columns-1,bmargin));
- clearImage(loc(0,bmargin-n+1),loc(columns-1,bmargin),' ');
+ if (n <= 0)
+ {
+ return;
+ }
+ if (from > bmargin)
+ {
+ return;
+ }
+ if ((from + n) > bmargin)
+ {
+ n = bmargin + 1 - from;
+ }
+
+ //FIXME: make sure `tmargin', `bmargin', `from', `n' is in bounds.
+ moveImage(loc(0, from), loc(0, from+n), loc(columns, bmargin));
+ clearImage(loc(0, bmargin-n+1), loc(columns-1, bmargin), ' ');
}
void TEScreen::scrollDown(int n)