mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
Rename subscription.destroy
to subscription.cancel
This commit is contained in:
parent
54c0c277ed
commit
e6362af711
@ -515,7 +515,7 @@ describe "Editor", ->
|
||||
rootView.height(200)
|
||||
rootView.width(200)
|
||||
|
||||
config.update("editor.fontSize", 10)
|
||||
config.update("editor.fontSize", fontSize)
|
||||
lineHeightBefore = editor.lineHeight
|
||||
charWidthBefore = editor.charWidth
|
||||
editor.setCursorScreenPosition [5, 6]
|
||||
@ -1559,6 +1559,7 @@ describe "Editor", ->
|
||||
expect(editor.renderedLines.find('.line').text()).toBe "•a line with tabs▸ and spaces•¬"
|
||||
|
||||
config.update("editor.showInvisibles", false)
|
||||
config.update()
|
||||
expect(editor.renderedLines.find('.line').text()).toBe " a line with tabs and spaces "
|
||||
|
||||
it "displays newlines(¬) as their own token outside of the other tokens scope", ->
|
||||
|
@ -65,7 +65,7 @@ class Config
|
||||
unless newValue == value
|
||||
value = newValue
|
||||
callback(value)
|
||||
subscription = { destroy: => @off 'update', updateCallback }
|
||||
subscription = { cancel: => @off 'update', updateCallback }
|
||||
@on 'update', updateCallback
|
||||
callback(value)
|
||||
subscription
|
||||
|
@ -10,14 +10,14 @@ _.extend View.prototype,
|
||||
|
||||
subscribe: (eventEmitter, eventName, callback) ->
|
||||
eventEmitter.on eventName, callback
|
||||
@addSubscription(destroy: -> eventEmitter.off eventName, callback)
|
||||
@addSubscription(cancel: -> eventEmitter.off eventName, callback)
|
||||
|
||||
addSubscription: (subscription) ->
|
||||
@subscriptions ?= []
|
||||
@subscriptions.push(subscription)
|
||||
|
||||
unsubscribe: ->
|
||||
subscription.destroy() for subscription in @subscriptions ? []
|
||||
subscription.cancel() for subscription in @subscriptions ? []
|
||||
|
||||
remove: (args...) ->
|
||||
@unsubscribe()
|
||||
|
Loading…
Reference in New Issue
Block a user