Creating selection, markers and removing it


Hey all,
I’m working on my @devunity package, as im adding a feature which lets you see who exactly is selecting text via coloring im stuck with an issue.
When ever someone highlights a line remotely it is broadcasted properly into atom, the color selection is decorated according to the remote user color. But, when the remote user deselects the selection remains and also multiple cursors are added…

the function im using right now is this: = this.atom.markBufferRange(cursorRange);
    cursorRange.cursor = cursor;
    cursorRange.decoration = this.atom.decorateMarker(, {type:'line',class:clazz});
    //cursorRange.selection = this.atom.setSelectedBufferRange(;
    cursorRange.selection = this.atom.addSelectionForBufferRange(;

im sorry, im just adding for future refer : solved it!


will void the selection and cursors. is this the best practice todo so?


tried doing this:

  editor = atom.workspace.getActiveEditor()
      curs = editor.getCursors();
      for (i=0;curs.length > 0;i++) {

at no luck. throws error that it cant find cursors screen position.