diff options
Diffstat (limited to 'konsole/konsole/TEScreen.cpp')
-rw-r--r-- | konsole/konsole/TEScreen.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/konsole/konsole/TEScreen.cpp b/konsole/konsole/TEScreen.cpp index 9bd62ff4d..d1d7985a5 100644 --- a/konsole/konsole/TEScreen.cpp +++ b/konsole/konsole/TEScreen.cpp @@ -81,7 +81,8 @@ TEScreen::TEScreen(int l, int c) ef_fg(cacol()), ef_bg(cacol()), ef_re(0), sa_cuX(0), sa_cuY(0), sa_cu_re(0), sa_cu_fg(cacol()), sa_cu_bg(cacol()), - lastPos(-1) + lastPos(-1), + lastDrawnChar(0) { /* this->lines = lines; @@ -300,6 +301,26 @@ void TEScreen::insertChars(int n) clearImage(loc(cuX,cuY),loc(q-1,cuY),' '); } +void TEScreen::repeatChars(int n) +{ + if (n == 0) + { + n = 1; // Default + } + + // From ECMA-48 version 5, section 8.3.103: + // "If the character preceding REP is a control function or part of a + // control function, the effect of REP is not defined by this Standard." + // + // So, a "normal" program should always use REP immediately after a visible + // character (those other than escape sequences). So, lastDrawnChar can be + // safely used. + for (int i = 0; i < n; i++) + { + ShowCharacter(lastDrawnChar); + } +} + /*! delete `n' lines starting from (including) the cursor position. The cursor is not moved by the operation. @@ -762,6 +783,8 @@ void TEScreen::ShowCharacter(unsigned short c) lastPos = i; + lastDrawnChar = c; + cuX += w--; while(w) |