summaryrefslogtreecommitdiff
path: root/src/ring.cc
diff options
context:
space:
mode:
authorEgmont Koblinger <egmont@gmail.com>2019-06-30 15:29:02 +0200
committerEgmont Koblinger <egmont@gmail.com>2019-06-30 15:29:02 +0200
commit3c6505bef69b6e4ee9e92cc8e9b6058109364ba5 (patch)
treeb7f1755dd807a36dc99e2078fac1cfd3e868d5c7 /src/ring.cc
parentf48b297427bd2adf02e12b44b7b528ebe15e409a (diff)
downloadvte-3c6505bef69b6e4ee9e92cc8e9b6058109364ba5.tar.gz
widget: Invalidate the entire paragraph when its contents change
This will soon be required by RingView and BiDi. https://gitlab.gnome.org/GNOME/vte/issues/53
Diffstat (limited to 'src/ring.cc')
-rw-r--r--src/ring.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ring.cc b/src/ring.cc
index 5e8c4533..f61c78ce 100644
--- a/src/ring.cc
+++ b/src/ring.cc
@@ -609,6 +609,27 @@ Ring::index(row_t position)
return &m_cached_row;
}
+bool
+Ring::is_soft_wrapped(row_t position)
+{
+ const VteRowData *row;
+ RowRecord record;
+
+ if (G_UNLIKELY (position < m_start || position >= m_end))
+ return false;
+
+ if (G_LIKELY (position >= m_writable)) {
+ row = get_writable_index(position);
+ return row->attr.soft_wrapped;
+ }
+
+ /* The row is scrolled out to the stream. Save work by not reading the actual row.
+ * The requested information is readily available in row_stream, too. */
+ if (G_UNLIKELY (!read_row_record(&record, position)))
+ return false;
+ return record.soft_wrapped;
+}
+
/*
* Returns the hyperlink idx at the given position.
*