Fix cursor movement on shortened deletes and refactor

This commit is contained in:
Andras Schmelczer 2025-04-13 23:06:07 +01:00
parent e2edc076b9
commit 35bb7f2405
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
4 changed files with 35 additions and 42 deletions

View file

@ -65,7 +65,7 @@ impl ExampleDocument {
for (i, cursor) in text.cursors.iter().enumerate() {
assert!(
cursor.char_index <= result.len(), // equals in case of insert at the end
"Cursor index out of bounds: {} > {}",
"Cursor index out of bounds: {} > {} when testing for '{result}'",
cursor.char_index,
result.len()
);