Hi Randika,
I think _updateBlockCursorVisible is way too low level (and not API). For me, the display cursors of the other participants are not real cursors (i.e they should not blink, etc). Otherwise they will get confused with the actual cursors (specially in multiple selection mode). The display cursors should be just annotations on top of the text (like error squiggles, etc).
Here is a snippet of code that adds several annotations (vertical coloured lines that resemble a cursor). Does this approach work for you? Let me if you need more details to try the snippet out.
var view = ....... the editor text view ........
var annotationStyler = ....... the editor annotation styler .........
annotationStyler.addAnnotationType("virtualCursors");
view.annotationModel.addAnnotation({
type: "virtualCursors",
start: 100,
end: 100,
rangeStyle: {
style: {
outline: "1px solid red"
}
}
});
view.annotationModel.addAnnotation({
type: "virtualCursors",
start: 130,
end: 130,
rangeStyle: {
style: {
outline: "1px solid green"
}
}
});
view.annotationModel.addAnnotation({
type: "virtualCursors",
start: 400,
end: 400,
rangeStyle: {
style: {
outline: "1px solid magenta"
}
}
});
----- Original message -----
From: Randika Navagamuwa <randika.12@xxxxxxxxxxxxx>
Sent by: orion-dev-bounces@xxxxxxxxxxx
To: Orion developer discussions <orion-dev@xxxxxxxxxxx>
Cc:
Subject: [orion-dev] Extending multi cursor feature
Date: Thu, Apr 28, 2016 11:10 AM
Hi all,
I'm trying to implement a feature for Eclipse che as a GSOC student, which would display cursors of other participants when having a pair programming session. Since che uses Orion editor I'm trying to add that to a standalone orion editor. As the initial step I went through the source code and managed to do this[1]. Click on multiple positions on the editor and there will be multiple cursors and cursors should be there without disappearing.
I was using the code, that is used in the _updateBlockCursorVisible function in built-codeEdit.js file to achieve this. I just want to know is there an easier way to achieve this or am I going on the correct path. It would be great if someone could point me in the right direction.
Thanks and regards,
Randika
--
Regards
Randika Navagamuwa,
Department of Computer Science & Engineering, University of Moratuwa, Sri Lanka.