diff options
author | Egmont Koblinger <egmont@gmail.com> | 2019-06-30 15:29:02 +0200 |
---|---|---|
committer | Egmont Koblinger <egmont@gmail.com> | 2019-06-30 15:29:02 +0200 |
commit | 3c6505bef69b6e4ee9e92cc8e9b6058109364ba5 (patch) | |
tree | b7f1755dd807a36dc99e2078fac1cfd3e868d5c7 /src/ring.cc | |
parent | f48b297427bd2adf02e12b44b7b528ebe15e409a (diff) | |
download | vte-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.cc | 21 |
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. * |