mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
[Gutter][style] Add parentheses to some method calls for readability
This commit is contained in:
parent
ee7625249f
commit
cc89f972dc
@ -31,10 +31,10 @@ class GutterContainer
|
||||
options = options ? {}
|
||||
gutterName = options.name
|
||||
if gutterName == null
|
||||
throw new Error 'A name is required to create a gutter.'
|
||||
if @gutterWithName gutterName
|
||||
throw new Error 'Tried to create a gutter with a name that is already in use.'
|
||||
newGutter = new Gutter this, options
|
||||
throw new Error('A name is required to create a gutter.')
|
||||
if @gutterWithName(gutterName)
|
||||
throw new Error('Tried to create a gutter with a name that is already in use.')
|
||||
newGutter = new Gutter(this, options)
|
||||
|
||||
inserted = false
|
||||
# Insert the gutter into the gutters array, sorted in ascending order by 'priority'.
|
||||
@ -81,7 +81,7 @@ class GutterContainer
|
||||
# Processes the destruction of the gutter. Throws an error if this gutter is
|
||||
# not within this gutterContainer.
|
||||
removeGutter: (gutter) ->
|
||||
index = @gutters.indexOf gutter
|
||||
index = @gutters.indexOf(gutter)
|
||||
if index > -1
|
||||
@gutters.splice(index, 1)
|
||||
@unsubscribe gutter
|
||||
@ -97,4 +97,4 @@ class GutterContainer
|
||||
else
|
||||
options.type = 'gutter'
|
||||
options.gutterName = gutter.name
|
||||
@textEditor.decorateMarker marker, options
|
||||
@textEditor.decorateMarker(marker, options)
|
||||
|
@ -49,7 +49,7 @@ class Gutter
|
||||
# * `item` (optional) A model {Object} with a corresponding view registered,
|
||||
# or an {HTMLElement}.
|
||||
decorateMarker: (marker, options) ->
|
||||
@gutterContainer.addGutterDecoration this, marker, options
|
||||
@gutterContainer.addGutterDecoration(this, marker, options)
|
||||
|
||||
# Calls your `callback` when the {Gutter}'s' visibility changes.
|
||||
#
|
||||
|
@ -114,7 +114,7 @@ class TextEditor extends Model
|
||||
@emit 'scroll-left-changed', scrollLeft if includeDeprecatedAPIs
|
||||
@emitter.emit 'did-change-scroll-left', scrollLeft
|
||||
|
||||
@gutterContainer = new GutterContainer this
|
||||
@gutterContainer = new GutterContainer(this)
|
||||
@lineNumberGutter = @gutterContainer.addGutter
|
||||
name: 'line-number'
|
||||
priority: 0
|
||||
@ -514,7 +514,7 @@ class TextEditor extends Model
|
||||
# Public: Creates and returns a {Gutter}.
|
||||
# See {GutterContainer::addGutter} for more details.
|
||||
addGutter: (options) ->
|
||||
@gutterContainer.addGutter options
|
||||
@gutterContainer.addGutter(options)
|
||||
|
||||
# Public: Returns the {Array} of all gutters on this editor.
|
||||
getGutters: ->
|
||||
@ -522,7 +522,7 @@ class TextEditor extends Model
|
||||
|
||||
# Public: Returns the {Gutter} with the given name, or null if it doesn't exist.
|
||||
gutterWithName: (name) ->
|
||||
@gutterContainer.gutterWithName name
|
||||
@gutterContainer.gutterWithName(name)
|
||||
|
||||
# Calls your `callback` when a {Gutter} is added to the editor.
|
||||
# Immediately calls your callback for each existing gutter.
|
||||
|
Loading…
Reference in New Issue
Block a user