textiter: don't read before the line attributes

Backported from GTK 3 commit ca3d87ce70 by Matthias Clasen.
This commit is contained in:
Daemonratte 2026-10-15 15:45:18 +02:00
commit 15ef87a7b6

View file

@ -3003,9 +3003,12 @@ inside_sentence_func (const PangoLogAttr *attrs,
gint len)
{
/* Find next sentence start or end */
while (offset >= min_offset &&
!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
--offset;
while (!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
{
--offset;
if (offset < min_offset)
return FALSE;
}
return attrs[offset].is_sentence_start;
}