mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03:00
Rename callbackImmediately option to callNow
This commit is contained in:
parent
08b80c15ad
commit
c2b3c2e3aa
@ -177,10 +177,10 @@ class Config
|
||||
# Establishes an event listener for a given key.
|
||||
#
|
||||
# `callback` is fired whenever the value of the key is changed and will
|
||||
# be fired immediately unless the `callbackImmediately` option is `false`.
|
||||
# be fired immediately unless the `callNow` option is `false`.
|
||||
#
|
||||
# keyPath - The {String} name of the key to watch
|
||||
# options - An optional {Object} containing the `callbackImmediately` key.
|
||||
# options - An optional {Object} containing the `callNow` key.
|
||||
# callback - The {Function} that fires when the. It is given a single argument, `value`,
|
||||
# which is the new value of `keyPath`.
|
||||
observe: (keyPath, options={}, callback) ->
|
||||
@ -198,7 +198,7 @@ class Config
|
||||
|
||||
subscription = { cancel: => @off 'updated', updateCallback }
|
||||
@on 'updated', updateCallback
|
||||
callback(value) if options.callbackImmediately ? true
|
||||
callback(value) if options.callNow ? true
|
||||
subscription
|
||||
|
||||
### Internal ###
|
||||
|
@ -56,10 +56,10 @@ class DisplayBuffer
|
||||
@trigger 'soft-wrap-changed', newValue
|
||||
@updateWrappedScreenLines()
|
||||
|
||||
@observeConfig 'editor.preferredLineLength', callbackImmediately: false, =>
|
||||
@observeConfig 'editor.preferredLineLength', callNow: false, =>
|
||||
@updateWrappedScreenLines() if @getSoftWrap() and config.get('editor.softWrapAtPreferredLineLength')
|
||||
|
||||
@observeConfig 'editor.softWrapAtPreferredLineLength', callbackImmediately: false, =>
|
||||
@observeConfig 'editor.softWrapAtPreferredLineLength', callNow: false, =>
|
||||
@updateWrappedScreenLines() if @getSoftWrap()
|
||||
|
||||
serialize: -> @state.clone()
|
||||
|
Loading…
Reference in New Issue
Block a user