During the development of helix-editor/helix#3890, @xJonathanLEI provided a test case that would cause a panic in ropey.
It turns out that PartialEq for RopeSlice indexes into a str using byte indices that might not be char bounds.
The fix for this issue was to simply operate on byte slices directly.
The very similar PartialOrd implementation has received the same treatment in the past but PartialEq seems to have been overlooked.
During the development of helix-editor/helix#3890, @xJonathanLEI provided a test case that would cause a panic in ropey.
It turns out that
PartialEq
forRopeSlice
indexes into astr
using byte indices that might not be char bounds. The fix for this issue was to simply operate on byte slices directly. The very similarPartialOrd
implementation has received the same treatment in the past butPartialEq
seems to have been overlooked.