mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Remove event handlers when editor is removed
This commit is contained in:
@@ -21,7 +21,8 @@ class BracketMatcher extends AtomPackage
|
||||
rootView.eachEditor (editor) => @subscribeToEditor(editor) if editor.attached
|
||||
|
||||
subscribeToEditor: (editor) ->
|
||||
editor.on 'cursor:moved', => @updateMatch(editor)
|
||||
editor.on 'cursor:moved.bracket-matcher', => @updateMatch(editor)
|
||||
editor.on 'editor:will-be-removed', => editor.off('.bracket-matcher')
|
||||
|
||||
createView: (editor, bufferPosition) ->
|
||||
pixelPosition = editor.pixelPositionForBufferPosition(bufferPosition)
|
||||
|
||||
Reference in New Issue
Block a user