Fix selection issues
- fix incorrect tokenization if the cursor is in the middle of a word
- fix bug where setting a space as a split char could prevent additional split chars from being set
- fix a crash when restoring text with a prefix would cause an index out of bounds exception