[vte/wip/egmont/bidi: 31/76] off by one



commit 51aa07c5365ae665bf4bb658e108eb171c6ee3e7
Author: Egmont Koblinger <egmont gmail com>
Date:   Fri Aug 24 09:45:25 2018 +0200

    off by one

 src/bidi.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/bidi.cc b/src/bidi.cc
index 0a110cfb..e7713912 100644
--- a/src/bidi.cc
+++ b/src/bidi.cc
@@ -282,7 +282,7 @@ long RingView::paragraph(long row)
 
         /* Extract the paragraph's contents, omitting unused and fragment cells. */
         while (row < m_start + m_len) {
-                row_data = m_ring->index(row++);
+                row_data = m_ring->index(row);
                 if (row_data == nullptr)
                         break;
 
@@ -306,6 +306,7 @@ long RingView::paragraph(long row)
                 }
 
                 lines[++line] = c;
+                row++;
 
                 if (!row_data->attr.soft_wrapped)
                         break;
@@ -351,7 +352,7 @@ long RingView::paragraph(long row)
                 m_bidirows[row - m_start].rtl = rtl;
                 map = m_bidirows[row - m_start].map;
 
-                row_data = m_ring->index(row++);
+                row_data = m_ring->index(row);
                 if (row_data == nullptr)
                         break;
 
@@ -456,6 +457,7 @@ long RingView::paragraph(long row)
 
 next_line:
                 line++;
+                row++;
 
                 if (!row_data->attr.soft_wrapped)
                         break;


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