summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2017-07-01 19:12:39 -0400
committerSlávek Banko <[email protected]>2021-10-11 10:03:11 +0200
commit0bb1c7eb4c2c423ebf52d199ad307e4163821a67 (patch)
tree1fb170e129228caaf61fe391d7012c32611c890b
parent838025df1cdfed31cfb086329cbf090b79d33159 (diff)
downloadtdebase-0bb1c7eb4c2c423ebf52d199ad307e4163821a67.tar.gz
tdebase-0bb1c7eb4c2c423ebf52d199ad307e4163821a67.zip
Konsole: Correct scrollUp behavior
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 <[email protected]>
-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 d3209b65c..f0ca2b176 100644
--- a/konsole/konsole/TEScreen.cpp
+++ b/konsole/konsole/TEScreen.cpp
@@ -825,10 +825,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)