atom-sublime-select icon indicating copy to clipboard operation
atom-sublime-select copied to clipboard

Example of writing a plugin to cope with multiple selections?

Open gingerbeardman opened this issue 8 years ago • 1 comments

As it is every plugin I've used that operates on a selection replaces all selections with the results of its work on the first selection.

gingerbeardman avatar Jul 17 '17 13:07 gingerbeardman

Hi, are you asking how you might go about creating a plugin that leaves any existing sections alone?

The line that replaces the selections is here https://github.com/bigfive/atom-sublime-select/blob/master/lib/editor-handler.coffee#L133

I imagine you would want to read all the existing selection ranges on mouse down, then add those existing selection ranges to the new ones added during _selectBoxAroundCursors.

If you manage it, I'd love to take a look. We could make it an optional feature.

bigfive avatar Sep 28 '18 08:09 bigfive