mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
Remove event handlers when editor is removed
This commit is contained in:
parent
0270ba3e1c
commit
b30fae7a68
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user