Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Extending multi cursor feature

Hi Silenio,
 Thanks for the quick response. Though we might need to change the code a bit, this sure will work. Is there an API to create or add annotations. If there is one then it will reduce a lot of work. In the mean time I'll try  go though this.

Thanks and regards,
Randika

On Fri, Apr 29, 2016 at 12:31 AM, Silenio Quarti <Silenio_Quarti@xxxxxxxxxx> wrote:
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.
lk.linkedin.com/in/rnavagamuwa/ https://www.facebook.com/rnavagamuwa https://twitter.com/rnavagamuwa  https://plus.google.com/+RandikaNavagamuwa/  
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/orion-dev
 


_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/orion-dev



--
Regards
Randika Navagamuwa,
Department of Computer Science & Engineering,
University of Moratuwa,
Sri Lanka.

Back to the top