DtTerm: fix formatted text in history buffer
authorStuart Brady <sdb@zubnet.me.uk>
Tue, 5 May 2015 08:53:07 +0000 (09:53 +0100)
committerJon Trulson <jon@radscan.com>
Tue, 5 May 2015 22:47:05 +0000 (16:47 -0600)
Formatted text currently gets corrupted by DtTerm when copied into its
history buffer.

As soon as a line of text is copied into the history, the text of each
segment of formatted text is altered so that it contains the text from
the start of the line.  For example:

    echo -e '\e[1mbold\e[m \e[4munderlined\e[m'

When the text has scrolled off the screen, scrolling back to it reveals:

    boldbbold under

This is fixed by adding the calls to _DtTermPrimBufferGetCharacterPointer
that were missing which would update the buffer pointer when inserting
text into the history buffer.

cde/lib/DtTerm/TermPrim/TermPrimRender.c

index 3f250f018ea1bcfb475215555aef3b09f416bd40..95827954659f615456e642a8cdadcde4280dd76e 100644 (file)
@@ -854,6 +854,9 @@ _DtTermPrimFillScreenGap(Widget w)
                                            eCol, eIndex, eValues[eIndex]);
                                    }
 
+                                   c1 = _DtTermPrimBufferGetCharacterPointer(
+                                           tBuffer, i1, eCol);
+
                                    (void) _DtTermPrimBufferInsert(
                                            tpd->historyBuffer,
                                            tpd->lastUsedHistoryRow,
@@ -879,6 +882,10 @@ _DtTermPrimFillScreenGap(Widget w)
                                            eCol, eIndex, 0);
                                    }
                                }
+
+                               c1 = _DtTermPrimBufferGetCharacterPointer(
+                                       tBuffer, i1, eCol);
+
                                (void) _DtTermPrimBufferInsert(
                                        tpd->historyBuffer,
                                        tpd->lastUsedHistoryRow,