Ah, I didn't notice that, it could have simplified a lot. I'll see if I can revert just the "insert mode" part of this pull request and implement it that way.