Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support cursors in ace #180

Merged
merged 3 commits into from
+49,171 −14,760

5 participants

@rissem

This is the minmal amount of work I had to do to get different
color cursors appearing in ace. It involved:

  • creating functions to convert ace ranges to cursors and vice versa
  • reaching into the ace internals to render cursors
  • emitting cursor events from the server to opened docs
  • add a couple cursor tests

Let me know if there's anything I can do to help get the cursors branch into master.

@rissem rissem Support cursors in ace
This is the minmal amount of work I had to do to get different
color cursors appearing in ace. It involved:

- creating functions to convert ace ranges to cursors and vice versa
- reaching into the ace internals to render cursors
- emitting cursor events from the server to opened docs
- add a couple cursor tests
51d8039
@luto

This breaks hello-ace.html horribly, when you enter text in FF or Chrome it just gets converted into garbage...
The example on the main-page works fine, though.

@rissem

Sorry about that. I was testing with a newer version of ace. I just upgraded ace, and the example now works for me. If necessary, I can try to make this code compatible with past versions.

The other thing I noticed playing with the example is that the cursor wasn't properly transformed when using the "text" type. Switching to "text2" fixed the example, but I imagine cursors will need to work with all text OT types.

@luto

Nice, it works fine now! :)
An other thing is that a client how has left the document is still shown, but afaik there is no disconnect-event..

@rissem

It should remove the cursor once the other client's socket has disconnected (after a 30 second timeout I believe). Does that not happen for you?

@luto

works.
@josephg you might want to take a look at this?

@luto

currently it is not supported to turn this off from a developers point of view, or is it?

@hatpick

Can you port this to Codemirror as well?

@josephg josephg merged commit ee711a7 into share:cursors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2013
  1. @rissem

    Support cursors in ace

    rissem authored
    This is the minmal amount of work I had to do to get different
    color cursors appearing in ace. It involved:
    
    - creating functions to convert ace ranges to cursors and vice versa
    - reaching into the ace internals to render cursors
    - emitting cursor events from the server to opened docs
    - add a couple cursor tests
Commits on Apr 3, 2013
  1. @rissem
  2. @rissem

    switch to text2 OT type

    rissem authored
Something went wrong with that request. Please try again.