summaryrefslogtreecommitdiffstats
path: root/konsole
diff options
context:
space:
mode:
Diffstat (limited to 'konsole')
-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)