Skip to content

Edit fuzzy match misses lines with differences in whitespace length #7836

Description

@robjgray

What happened?

normalizeForFuzzyMatch doesn't collapse runs of whitespace or strip leading whitespace. Edit's oldText fails the fuzzy match when the whitespace isn't exact, even though the content is identical. I found his while looking into some problems small models were having with the edit tool. The same problem can occur with pi -ne and no extensions loaded.

Steps to reproduce

Edit a line where the only difference from oldText is the length of a whitespace section.

  • a b vs a b

Expected behavior

I expected the fuzzy match to catch it and treat whitespace sections as equivalent. So whitespace-only differences would still lead to a match.

Version

0.80.5

NOTE: I investigated this with GLM-5.2 in Pi. Originally it eagerly raised the issue with a freeform issue body and verbose title before I fully reviewed the problem - truly sorry about that!

Metadata

Metadata

Assignees

Labels

inprogressIssue is being worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions