diff options
author | Kurt Hindenburg <[email protected]> | 2017-07-01 19:12:39 -0400 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2021-10-11 10:15:13 +0200 |
commit | a13485e3059e968b89b09d74bc4967f4843783ff (patch) | |
tree | 2e7853aaaff03b445aad8df56535c1ff38d91e14 | |
parent | af843540a007f7f2ad542d262d7cd10bc3ba4614 (diff) | |
download | tdebase-a13485e3059e968b89b09d74bc4967f4843783ff.tar.gz tdebase-a13485e3059e968b89b09d74bc4967f4843783ff.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]>
(cherry picked from commit 0bb1c7eb4c2c423ebf52d199ad307e4163821a67)
-rw-r--r-- | konsole/konsole/TEScreen.cpp | 20 |
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) |