"Next search hit" scrolling in mail view is busted. The main issue
is that we were scrolling to line n where n is the search hit
number, rather of the line number of the search hit. Reference
field _2 instead of _1 to resolve this issue.
A secondary issue is scrolling did not account for inter-paragraph
padding. As a result, the scroll point diverges from the search hit
at a rate of one line per paragraph. With sufficiently many
paragraphs the search hit is not in the viewport. To resolve this
issue, eliminate the whole [Paragraph] type. Use a flat [Line]
instead.
Also eliminate the "line number" field from the Line data type.
Instead, use an indexed traversal to reveal the line number when
searching for occurrences of the search string. This change further
simplifies MailBody construction and avoids storing unnecessary
data.
"Next search hit" scrolling in mail view is busted. The main issue is that we were scrolling to line n where n is the search hit number, rather of the line number of the search hit. Reference field
_2
instead of_1
to resolve this issue.A secondary issue is scrolling did not account for inter-paragraph padding. As a result, the scroll point diverges from the search hit at a rate of one line per paragraph. With sufficiently many paragraphs the search hit is not in the viewport. To resolve this issue, eliminate the whole
[Paragraph]
type. Use a flat[Line]
instead.Also eliminate the "line number" field from the
Line
data type. Instead, use an indexed traversal to reveal the line number when searching for occurrences of the search string. This change further simplifiesMailBody
construction and avoids storing unnecessary data.Fixes: https://github.com/purebred-mua/purebred/issues/448