marijnh/CodeMirror — pull request #2542 by mtaran-google (2014-05-06 18:46:23+00:00)
Title: [sublime] Make swapLineUp/Down consistent with Sublime Text behavior.

Currently if you select part of line L, extend the selection just past the end, and use swapLineUp/Down, it will swap both line L and line L+1. In Sublime Text it would only shift line L. This also makes it more consistent with the rest of CodeMirror since tooggleComment with that selection only toggles the comment on line L.

Of course if the selection is of length zero (i.e. a cursor) at the beginning of line L+1, only line L+1 should be shifted.

Note: This currently works incorrectly for swapLineUp because of some special casing in that code. I tried to fix it but couldn't grok exactly what was happening. I'm hoping you can make the relevant fix since you wrote the code :)