rajdeep / proton

Purely native and extensible rich text editor for iOS and macOS Catalyst apps
Other
1.28k stars 82 forks source link

Crash when sometimes escaping a list #147

Closed bryan1anderson closed 1 year ago

bryan1anderson commented 2 years ago

Thread 1: "*** -[NSBigMutableString _getBlockStart:end:contentsEnd:forRange:stopAtLineSeparators:]: Range {7, 0} out of bounds; string length 6"

Basically I just go in, create a list and then hit enter to reproduce

rajdeep commented 2 years ago

@bryan1anderson, can you please provide detailed steps or the text that you are putting in the list? I am not able to recreate it with what you have mentioned.

ChristopherAdelmann commented 1 year ago

I have similar Problems. A more detailed explanation:

It appears that in textViewDidChange(_ textView:) of RichTextEditorContext the richTextView.selectedRange is out of bounds and might cause the problems. Simulator Screen Shot - iPad (10th generation) - 2023-04-09 at 21 21 34

rajdeep commented 1 year ago

thank you for providing the steps @ChristopherAdelmann. I was able to narrow down and fix the crash. Please try the latest main.

https://user-images.githubusercontent.com/266423/230874885-2077e187-b93d-40dd-b69c-b92f09c135bf.mp4