From 1bd9a6bef3baf6609ec488b8681ccaf38c89dab4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki & Nathan Sobo Date: Tue, 23 Jul 2013 16:44:51 -0700 Subject: [PATCH] Display cursors from all replicas --- spec/app/editor-replication-spec.coffee | 5 ++++- src/app/edit-session.coffee | 3 +++ src/app/editor.coffee | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/app/editor-replication-spec.coffee b/spec/app/editor-replication-spec.coffee index c24bda522..fbc339cdf 100644 --- a/spec/app/editor-replication-spec.coffee +++ b/spec/app/editor-replication-spec.coffee @@ -29,6 +29,9 @@ describe "Editor replication", -> env1.destroy() env2.destroy() - it "displays the selections from all replicas", -> + it "displays the cursors and selections from all replicas", -> expect(editor1.getSelectionViews().length).toBe 2 expect(editor2.getSelectionViews().length).toBe 2 + + expect(editor1.getCursorViews().length).toBe 2 + expect(editor2.getCursorViews().length).toBe 2 diff --git a/src/app/edit-session.coffee b/src/app/edit-session.coffee index fd647b0df..cb03047cf 100644 --- a/src/app/edit-session.coffee +++ b/src/app/edit-session.coffee @@ -827,6 +827,9 @@ class EditSession hasMultipleCursors: -> @getCursors().length > 1 + getAllCursors: -> + @getCursors().concat(@getRemoteCursors()) + # Retrieves all the cursors. # # Returns an {Array} of {Cursor}s. diff --git a/src/app/editor.coffee b/src/app/editor.coffee index a96fbf37c..7938d35f8 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -1101,7 +1101,7 @@ class Editor extends View @updateLayerDimensions() @scrollTop(editSessionScrollTop) @scrollLeft(editSessionScrollLeft) - @newCursors = @activeEditSession.getCursors() + @newCursors = @activeEditSession.getAllCursors() @newSelections = @activeEditSession.getAllSelections() @updateDisplay(suppressAutoScroll: true)