Fix lastIndexOf off-by-one confusion in composition handling
Fix lastIndexOf off-by-one confusion in composition handling

FIX: Fix an issue where compositions right before another instance of the
composed text could cause the editor to crash.

Issue https://github.com/ProseMirror/prosemirror/issues/1226

ProseMirror/prosemirror-view