[haiku-commits] haiku: hrev45483 - src/apps/terminal

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 11 Apr 2013 22:25:06 +0200 (CEST)

hrev45483 adds 1 changeset to branch 'master'
old head: 7e1f9635967f7a3cc28eadfb4bd0bff110cbff22
new head: 07d1d01afc6082092782452d1b793c3d1e60c6a6
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=07d1d01+%5E7e1f963

----------------------------------------------------------------------------

07d1d01: Fix resize freeze on full-width chars in Terminal history
  
  In the Terminal data model every full width character occupies two cells
  in the data buffers. The second cell of such characters is not drawn and
  used mainly to differentiate between full width and half width
  characters.
  Proposed fix zeroes the attributes of the second cell in the
  HistoryBuffer::GetTerminalLineAt() that prevents the potential endless
  loops in the BasicTerminalBuffer::_ResizeRedraw(). Those loops were
  result of the random attributes in full width character's second cells.

                                        [ Siarzhuk Zharski <zharik@xxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45483
Commit:      07d1d01afc6082092782452d1b793c3d1e60c6a6
URL:         http://cgit.haiku-os.org/haiku/commit/?id=07d1d01
Author:      Siarzhuk Zharski <zharik@xxxxxx>
Date:        Thu Apr 11 19:45:28 2013 UTC

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 1 deletion(-)
src/apps/terminal/HistoryBuffer.cpp | 4 +++-

----------------------------------------------------------------------------

diff --git a/src/apps/terminal/HistoryBuffer.cpp 
b/src/apps/terminal/HistoryBuffer.cpp
index 3202c5a..ada86f5 100644
--- a/src/apps/terminal/HistoryBuffer.cpp
+++ b/src/apps/terminal/HistoryBuffer.cpp
@@ -121,7 +121,9 @@ HistoryBuffer::GetTerminalLineAt(int32 index, TerminalLine* 
buffer) const
                // full width char?
                if (cell.character.IsFullWidth()) {
                        cell.attributes |= A_WIDTH;
-                       charCount++;
+                       // attributes of the second, "invisible" cell must be
+                       // cleared to let full-width chars detection work 
properly
+                       buffer->cells[charCount++].attributes = 0;
                }
        }
 


Other related posts:

  • » [haiku-commits] haiku: hrev45483 - src/apps/terminal - zharik