Restore full verse-range expansion in BackEnd::parse_verse_list() - #1377
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A previous fix (in the tag-color-highlighting branch) switched this
function's iteration from a popError()-driven while(vs++) loop to
indexed access via vs.getElement(i), to stop one malformed fragment
in a multi-reference list from truncating everything after it.
That change had a side effect: the old vs++ iteration transparently
expanded hyphenated verse ranges (e.g. "Jer 3:6-11") into one entry
per verse, but getElement(i) returns each range as a single,
unexpanded entry whose getText() only reports the start verse.
Every caller of parse_verse_list() -- the verse-list popup, the
sidebar cross-reference list, and bookmark tag-color highlighting --
was silently dropping the rest of any such range.
Empirically, for a ListKey element that represents a range,
getUpperBound() (and getLowerBound(), which mirrors it here) return
the END of the range; for a plain single verse they are equal to the
element itself. Detect that difference and, when present, walk every
verse from the element (start) through the upper bound (end) via
increment(), adding each individually -- restoring the original
full-range expansion behavior for every caller of this function.