proton icon indicating copy to clipboard operation
proton copied to clipboard

Crash when sometimes escaping a list

Open bryan1anderson opened this issue 3 years ago • 1 comments

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

bryan1anderson avatar Jun 27 '22 21:06 bryan1anderson

@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.

rajdeep avatar Jun 28 '22 08:06 rajdeep

I have similar Problems. A more detailed explanation:

  • Create List
  • Return (New line)
  • Indent List
  • Return (New line)
  • Crash (Thread 1: "*** -[NSBigMutableString _getBlockStart:end:contentsEnd:forRange:stopAtLineSeparators:]: Range {4, 0} out of bounds; string length 3")

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

ChristopherAdelmann avatar Apr 09 '23 19:04 ChristopherAdelmann

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

rajdeep avatar Apr 10 '23 09:04 rajdeep