--- konsole-4.7.2/src/Character.h +++ konsole-4.7.2/src/Character.h @@ -67,8 +67,9 @@ inline Character(quint16 _c = ' ', CharacterColor _f = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR), CharacterColor _b = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR), - quint8 _r = DEFAULT_RENDITION) - : character(_c), rendition(_r), foregroundColor(_f), backgroundColor(_b) {} + quint8 _r = DEFAULT_RENDITION, + bool _real = true) + : character(_c), rendition(_r), foregroundColor(_f), backgroundColor(_b), isRealCharacter(_real) {} union { @@ -92,6 +93,17 @@ /** The color used to draw this character's background. */ CharacterColor backgroundColor; + /** Indicate whether this character really exists, or exists simply as place holder. + * + * TODO: this boolean filed can be further improved to become a enum filed, which + * indicates different roles: + * + * RealCharacter: a character which really exists + * PlaceHolderCharacter: a character which exists as place holder + * TabStopCharacter: a special place holder for HT('\t') + */ + bool isRealCharacter; + /** * Returns true if this character has a transparent background when * it is drawn with the specified @p palette. --- konsole-4.7.2/src/Screen.cpp +++ konsole-4.7.2/src/Screen.cpp @@ -65,7 +65,8 @@ Character Screen::defaultChar = Character(' ', CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR), CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR), - DEFAULT_RENDITION); + DEFAULT_RENDITION, + false); //#define REVERSE_WRAPPED_LINES // for wrapped line debug @@ -663,6 +664,7 @@ currentChar.foregroundColor = effectiveForeground; currentChar.backgroundColor = effectiveBackground; currentChar.rendition = effectiveRendition; + currentChar.isRealCharacter = true; int i = 0; int newCursorX = cuX + w--; @@ -678,6 +680,7 @@ ch.foregroundColor = effectiveForeground; ch.backgroundColor = effectiveBackground; ch.rendition = effectiveRendition; + ch.isRealCharacter = false; w--; } @@ -813,7 +816,7 @@ int topLine = loca/columns; int bottomLine = loce/columns; - Character clearCh(c,currentForeground,currentBackground,DEFAULT_RENDITION); + Character clearCh(c,currentForeground,currentBackground,DEFAULT_RENDITION,false); //if the character being used to clear the area is the same as the //default character, the affected lines can simply be shrunk. --- konsole-4.7.2/src/TerminalCharacterDecoder.cpp +++ konsole-4.7.2/src/TerminalCharacterDecoder.cpp @@ -102,8 +102,15 @@ for (int i=0;i