Yes, this always shows selection horizontally, but it cancels the "center vertically" functionality. I see the same results with:

```
            editor.setSelection(cursor.from(), cursor.to(), false);
            //cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
```

I think the problem may be that the `Editor.centerOnCursor()` function passes null as x position to `this.setScroll()`. Maybe that used to work and there was a change in CodeMirror. Try looking into `cm.scrollIntoView()` to see what it's doing.