[vte/wip/egmont/bidi: 9/87] carry bidi_flags to more places



commit bffe5f9c9c67f6572bdde4cf9fe6e1401aa56097
Author: Egmont Koblinger <egmont gmail com>
Date:   Sun Aug 19 22:30:25 2018 +0200

    carry bidi_flags to more places

 src/ring.cc       | 2 ++
 src/ring.hh       | 1 +
 src/vte.cc        | 1 +
 src/vterowdata.cc | 3 +++
 src/vteseq.cc     | 3 +++
 5 files changed, 10 insertions(+)
---
diff --git a/src/ring.cc b/src/ring.cc
index 72549961..58fd645d 100644
--- a/src/ring.cc
+++ b/src/ring.cc
@@ -373,6 +373,7 @@ Ring::freeze_row(row_t position,
        if (!row->attr.soft_wrapped)
                g_string_append_c (buffer, '\n');
        record.soft_wrapped = row->attr.soft_wrapped;
+       record.bidi_flags = row->attr.bidi_flags;
 
        _vte_stream_append(m_text_stream, buffer->str, buffer->len);
        append_row_record(&record, position);
@@ -435,6 +436,7 @@ Ring::thaw_row(row_t position,
                 g_string_truncate (buffer, buffer->len - 1);
        else
                row->attr.soft_wrapped = TRUE;
+       row->attr.bidi_flags = records[0].bidi_flags;
 
        p = buffer->str;
        end = p + buffer->len;
diff --git a/src/ring.hh b/src/ring.hh
index a5af734a..f0f82fdd 100644
--- a/src/ring.hh
+++ b/src/ring.hh
@@ -120,6 +120,7 @@ private:
                 size_t attr_start_offset;  /* offset of the first character's attributes */
                 int soft_wrapped: 1;      /* end of line is not '\n' */
                 int is_ascii: 1;          /* for rewrapping speedup: guarantees that line contains 32..126 
bytes only. Can be 0 even when ascii only. */
+                guint8 bidi_flags: 3;
         } RowRecord;
 
         static_assert(std::is_pod<RowRecord>::value, "Ring::RowRecord is not POD");
diff --git a/src/vte.cc b/src/vte.cc
index 23b2d3df..50ff80b3 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -3045,6 +3045,7 @@ Terminal::maybe_apply_bidi_attributes()
                 if (rowdata == nullptr)
                         return;
                 rowdata->attr.bidi_flags = get_bidi_flags();
+                invalidate_cells(0, m_column_count, row, 1);
                 if (!rowdata->attr.soft_wrapped)
                         return;
                 row++;
diff --git a/src/vterowdata.cc b/src/vterowdata.cc
index 88edba1a..cef1858f 100644
--- a/src/vterowdata.cc
+++ b/src/vterowdata.cc
@@ -82,7 +82,10 @@ _vte_cells_free (VteCells *cells)
 void
 _vte_row_data_init (VteRowData *row)
 {
+       // FIXME pass the bidi attrs to this method?
+       guint8 bidi_flags_save = row->attr.bidi_flags;
        memset (row, 0, sizeof (*row));
+       row->attr.bidi_flags = bidi_flags_save;
 }
 
 void
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 7304b42a..18b21ac8 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -315,6 +315,7 @@ Terminal::clear_current_line()
                /* Add enough cells to the end of the line to fill out the row. */
                 _vte_row_data_fill (rowdata, &m_fill_defaults, m_column_count);
                rowdata->attr.soft_wrapped = 0;
+                rowdata->attr.bidi_flags = get_bidi_flags();
                /* Repaint this row. */
                 invalidate_row(m_screen->cursor.row);
        }
@@ -339,6 +340,7 @@ Terminal::clear_above_current()
                        /* Add new cells until we fill the row. */
                         _vte_row_data_fill (rowdata, &m_fill_defaults, m_column_count);
                        rowdata->attr.soft_wrapped = 0;
+                        rowdata->attr.bidi_flags = get_bidi_flags();
                        /* Repaint the row. */
                         invalidate_row(i);
                }
@@ -739,6 +741,7 @@ Terminal::clear_below_current()
                         _vte_row_data_fill(rowdata, &m_fill_defaults, m_column_count);
                }
                rowdata->attr.soft_wrapped = 0;
+                rowdata->attr.bidi_flags = get_bidi_flags();
                /* Repaint this row. */
                 invalidate_row(i);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]