[vim/vim] matchfuzzypos() false exact match for long equal-length candidates (PR #20475)

2 views
Skip to first unread message

glepnir

unread,
12:43 AM (2 hours ago) 12:43 AM
to vim/vim, Subscribed

Problem: When a candidate gets truncated to MATCH_MAX_LEN and ends up the same length as the needle, the n == m shortcut would return SCORE_MAX with positions 0..n-1, even if the strings actually differ.
eg: matchfuzzypos(['x' .. repeat('a',1024)], repeat('a',1024))

Solution: Only use the shortcut if the truncated strings are truly equal. Otherwise, fall back to regular matching.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20475

Commit Summary

  • f2accce matchfuzzypos() false exact match for long equal-length candidates

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20475@github.com>

Reply all
Reply to author
Forward
0 new messages