mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
feat: reach forward by the declared member count
This commit is contained in:
1 parent
4f7aa5f853
commit
7ac19f4c9f
2 files changed
+6
-3
No files matched your search
@@ -729,8 +729,11 @@ def verify_at_pin(part: RefPart, pin_lines, tokens) -> PartResult:
|
||||
)
|
||||
if not tokens:
|
||||
return PartResult(part, "ANCHORED", None, None, None, [])
|
||||
# An archive ref cites the line declaring the set; its members follow, one
|
||||
# per line, so the window reaches forward as far as the entry has members.
|
||||
reach = SELF_CHECK_CONTEXT + len(tokens)
|
||||
lo = max(0, part.start - 1 - SELF_CHECK_CONTEXT)
|
||||
hi = min(len(pin_lines), (part.end or part.start) + SELF_CHECK_CONTEXT)
|
||||
hi = min(len(pin_lines), (part.end or part.start) + reach)
|
||||
window = "\n".join(pin_lines[lo:hi]).lower()
|
||||
if any(token in window for token in tokens):
|
||||
return PartResult(part, "ANCHORED", None, None, None, [])
|
||||
|
||||
Reference in new issue
Block a user