diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index 180efeeb5..b3f268b56 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -2264,6 +2264,10 @@ describe "TextEditorComponent", -> wrapperView.detach() wrapperView.attachToDom() + wrapperView.trigger('core:move-right') + + expect(editor.getCursorBufferPosition()).toEqual [0, 1] + buildMouseEvent = (type, properties...) -> properties = extend({bubbles: true, cancelable: true}, properties...) properties.detail ?= 1 diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 270404ef4..8519ac21d 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -514,8 +514,8 @@ TextEditorComponent = React.createClass addCommandListeners: (listenersByCommandName) -> {parentView} = @props - addListener = (command, listener) -> - parentView.command command, (event) -> + addListener = (command, listener) => + @subscribe parentView.command command, (event) -> event.stopPropagation() listener(event)