Multiple cursor issues


It would seem to me that multiple cursors is still far from perfect. In some ways this is a package support issue (the toggle-quotes package doesn’t currently support multiple cursors, though I do have a PR that’ll hopefully get merged). But also there are some issues in the core (or at least I think it’s the core, it’s hard to tell with Atom!), for example I too have noticed the issue referenced here (only one line highlighted with multiple cursors on different lines).

Additionally to that, while working on my PR for the toggle-quotes package I noticed that some API support is kinda lacking too. For example, Editor has Editor::bufferRangeForScopeAtCursor() which is used in the current version of toggle-quotes, but only supports a single cursor (the last one placed, much like the line highlight issue mentioned above), but in making the package deal with multiple cursors I found there was no method like Editor::bufferRangeForScopeAtPosition() (even though such a method actually exists on the underlying displayBuffer) so I’ve had to use editor.displayBuffer.bufferRangeForScopeAtPosition(). That wasn’t too difficult to work out (thanks to the ability to look at the implementation of Editor::bufferRangeForScopeAtCursor() in the console), but it feels like it’s missing, and using the displayBuffer object is probably not the way the Atom authors expect developer to use Atom's API. SimilarlyEditor::getCursorScopes()` also assumes a single cursor, and there may be more.

As such, I suggest taking a little time looking into this and ensuring that anything related to the cursor either returns an array with entries equivalent to the number of cursors, or allows for developers wishing to provide multiple cursor support in their packages in some other way (such as providing Editor::bufferRangeForScopeAtPosition()).

Other than this issue (which is a core selling point for text editors these days) I’m liking what I’m seeing so far. There are definitely some things that aren’t great, but hey we’re in beta right?

A few feature requests