I was sometimes getting an console error whenever I would try to delete a new-line character. I narrowed it down to a line of code in the CRDT class in the handleLocalDelete method. The method would try to remove characters from a line even if there were no characters on that line. I added a guard clause to handle the error.
I also realized the logic on the handleLocalDelete method was pretty complicated so I refactored it into several smaller methods so that it's easier to read.
I was sometimes getting an console error whenever I would try to delete a new-line character. I narrowed it down to a line of code in the
CRDT
class in thehandleLocalDelete
method. The method would try to remove characters from a line even if there were no characters on that line. I added a guard clause to handle the error.I also realized the logic on the
handleLocalDelete
method was pretty complicated so I refactored it into several smaller methods so that it's easier to read.closes #5