mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
[Gutter] Convert ! to 'not', && to 'and'
This commit is contained in:
@@ -26,7 +26,7 @@ class CustomGutterComponent
|
||||
@visible = false
|
||||
|
||||
showNode: ->
|
||||
if !@visible
|
||||
if not @visible
|
||||
@domNode.style.removeProperty('display')
|
||||
@visible = true
|
||||
|
||||
@@ -50,7 +50,7 @@ class CustomGutterComponent
|
||||
@decorationsNode.appendChild(newNode)
|
||||
|
||||
for decorationId, decorationNode of @decorationNodesById
|
||||
if !updatedDecorationIds.has(decorationId)
|
||||
if not updatedDecorationIds.has(decorationId)
|
||||
decorationNode.remove()
|
||||
delete @decorationNodesById[decorationId]
|
||||
delete @decorationItemsById[decorationId]
|
||||
@@ -88,10 +88,10 @@ class CustomGutterComponent
|
||||
existingNode.style.height = newDecorationInfo.height + 'px'
|
||||
oldPositionState.height = newDecorationInfo.height + 'px'
|
||||
|
||||
if newDecorationInfo.class and !existingNode.classList.contains(newDecorationInfo.class)
|
||||
if newDecorationInfo.class and not existingNode.classList.contains(newDecorationInfo.class)
|
||||
existingNode.className = 'decoration'
|
||||
existingNode.classList.add(newDecorationInfo.class)
|
||||
else if !newDecorationInfo.class
|
||||
else if not newDecorationInfo.class
|
||||
existingNode.className = 'decoration'
|
||||
|
||||
@setDecorationItem(newDecorationInfo.item, newDecorationInfo.height, decorationId, existingNode)
|
||||
|
||||
@@ -31,7 +31,7 @@ class GutterContainerComponent
|
||||
newGutterComponentsByGutterName = {}
|
||||
for {gutter, visible} in newState
|
||||
gutterComponent = @gutterComponentsByGutterName[gutter.name]
|
||||
if !gutterComponent
|
||||
if not gutterComponent
|
||||
if gutter.name is 'line-number'
|
||||
gutterComponent = new LineNumberGutterComponent({onMouseDown: @onLineNumberGutterMouseDown, @editor, gutter})
|
||||
@lineNumberGutterComponent = gutterComponent
|
||||
@@ -66,7 +66,7 @@ class GutterContainerComponent
|
||||
if existingGutterComponent.getName() == gutterComponent.getName()
|
||||
matchingGutterFound = true
|
||||
break
|
||||
if !matchingGutterFound
|
||||
if not matchingGutterFound
|
||||
# If we've reached this point, the gutter previously existed, but its
|
||||
# position has moved. Remove it from the DOM and re-insert it.
|
||||
gutterComponent.getDomNode().remove()
|
||||
@@ -80,5 +80,5 @@ class GutterContainerComponent
|
||||
|
||||
# Remove any gutters that were not present in the new gutters state.
|
||||
for gutterComponent in @gutterComponents
|
||||
if !newGutterComponentsByGutterName[gutterComponent.getName()]
|
||||
if not newGutterComponentsByGutterName[gutterComponent.getName()]
|
||||
gutterComponent.getDomNode().remove()
|
||||
|
||||
@@ -44,7 +44,7 @@ class GutterContainer
|
||||
@gutters.splice(i, 0, newGutter)
|
||||
inserted = true
|
||||
break
|
||||
if !inserted
|
||||
if not inserted
|
||||
@gutters.push newGutter
|
||||
@emitter.emit 'did-add-gutter', newGutter
|
||||
return newGutter
|
||||
|
||||
@@ -29,7 +29,7 @@ class LineNumberGutterComponent
|
||||
@visible = false
|
||||
|
||||
showNode: ->
|
||||
if !@visible
|
||||
if not @visible
|
||||
@domNode.style.removeProperty('display')
|
||||
@visible = true
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@ class TextEditorPresenter
|
||||
for gutter in @model.getGutters()
|
||||
gutterName = gutter.name
|
||||
@state.gutters.customDecorations[gutterName] = {}
|
||||
return if !@gutterIsVisible(gutter)
|
||||
return if not @gutterIsVisible(gutter)
|
||||
|
||||
relevantDecorations = @customGutterDecorationsInRange(gutterName, @startRow, @endRow - 1)
|
||||
relevantDecorations.forEach (decoration) =>
|
||||
@@ -448,7 +448,7 @@ class TextEditorPresenter
|
||||
gutterIsVisible: (gutterModel) ->
|
||||
isVisible = gutterModel.isVisible()
|
||||
if gutterModel.name is 'line-number'
|
||||
isVisible = isVisible && @showLineNumbers
|
||||
isVisible = isVisible and @showLineNumbers
|
||||
isVisible
|
||||
|
||||
updateLineNumbersState: -> @batch "shouldUpdateLineNumbersState", ->
|
||||
@@ -649,7 +649,7 @@ class TextEditorPresenter
|
||||
decorations = new Set
|
||||
|
||||
return decorations if @model.isMini() or gutterName is 'line-number' or
|
||||
!@customGutterDecorationsByGutterNameAndScreenRow[gutterName]
|
||||
not @customGutterDecorationsByGutterNameAndScreenRow[gutterName]
|
||||
|
||||
for bufferRow in @model.bufferRowsForScreenRows(@startRow, @endRow - 1)
|
||||
for id, decoration of @customGutterDecorationsByGutterNameAndScreenRow[gutterName][bufferRow]
|
||||
@@ -995,8 +995,8 @@ class TextEditorPresenter
|
||||
@updateLinesState()
|
||||
if decoration.isType('line-number') or Decoration.isType(oldProperties, 'line-number')
|
||||
@updateLineNumbersState()
|
||||
if (decoration.isType('gutter') and !decoration.isType('line-number')) or
|
||||
(Decoration.isType(oldProperties, 'gutter') and !Decoration.isType(oldProperties, 'line-number'))
|
||||
if (decoration.isType('gutter') and not decoration.isType('line-number')) or
|
||||
(Decoration.isType(oldProperties, 'gutter') and not Decoration.isType(oldProperties, 'line-number'))
|
||||
@updateCustomGutterDecorationState()
|
||||
else if decoration.isType('overlay')
|
||||
@updateOverlaysState()
|
||||
|
||||
@@ -1308,7 +1308,7 @@ class TextEditor extends Model
|
||||
#
|
||||
# Returns a {Decoration} object
|
||||
decorateMarker: (marker, decorationParams) ->
|
||||
if decorationParams.type is 'gutter' && !decorationParams.gutterName
|
||||
if decorationParams.type is 'gutter' and not decorationParams.gutterName
|
||||
deprecate("Decorations of `type: 'gutter'` have been renamed to `type: 'line-number'`.")
|
||||
decorationParams.type = 'line-number'
|
||||
@displayBuffer.decorateMarker(marker, decorationParams)
|
||||
|
||||
Reference in New Issue
Block a user