atom/toggle-quotes — pull request #4 by alexrussell (2014-04-07 13:57:36+00:00)
Title: Add support for multiple cursors

I can't guarantee my Coffeescript skills are tip top here as I don't use it, nor whether it could have been done a better way.

Screenshot/movie:

![multiple_quotes](https://cloud.githubusercontent.com/assets/412784/2631682/07f28864-be5c-11e3-8905-bdd7274e31ea.gif)

I have a feeling the Atom core needs to open up a little on the cursors front - the previous code used `editor.getCursorBufferPosition()` to get the position of the cursor, but that assumes a single cursor (and it defaults to the last cursor in the cursors array). In order to support multiple cursors, I had to use `editor.getCursors()` to get all the cursors then `editor.displayBuffer.bufferRangeForScopeAtPosition('.string.quoted', cursor.getBufferPosition())` which, due to its use of the `editor.displayBuffer` object directly is probably not the best use of the API.

I have added a test here to test that multiple cursors work, though I haven't documented my methods. The original code was undocumented and I have a feeling I'd have done it wrong anyway, so I've left it not-done.