Apply patch for updateSelection

From https://github.com/marijnh/CodeMirror/pull/2725
Apply @marijnh 's patch
Merge pull request #1723 from jsbin/fix/vim-cm

Apply patch for updateSelection