mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Subscribe to editor commands
We need to unsubscribe when the editor is removed! Closes #3651
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user