mirror of
https://github.com/atom/atom.git
synced 2026-02-09 22:24:59 -05:00
change toggle-fold to fold
This commit is contained in:
@@ -56,17 +56,15 @@ class DisplayBuffer
|
||||
|
||||
@createFold(startRow, endRow)
|
||||
|
||||
toggleFoldAtBufferRow: (bufferRow) ->
|
||||
foldScopeContainingBufferRow: (bufferRow) ->
|
||||
for currentRow in [bufferRow..0]
|
||||
[startRow, endRow] = @tokenizedBuffer.rowRangeForFoldAtBufferRow(currentRow) ? []
|
||||
continue unless startRow? and startRow <= bufferRow <= endRow
|
||||
fold = @largestFoldStartingAtBufferRow(startRow)
|
||||
@createFold(startRow, endRow) unless fold
|
||||
|
||||
if fold = @largestFoldStartingAtBufferRow(startRow)
|
||||
fold.destroy()
|
||||
else
|
||||
@createFold(startRow, endRow)
|
||||
return
|
||||
|
||||
break
|
||||
|
||||
isFoldContainedByActiveFold: (fold) ->
|
||||
for row, folds of @activeFolds
|
||||
|
||||
@@ -198,19 +198,16 @@ class EditSession
|
||||
redo: ->
|
||||
@buffer.redo(this)
|
||||
|
||||
fold: ->
|
||||
bufferRow = @bufferPositionForScreenPosition(@getCursorScreenPosition()).row
|
||||
@foldAtBufferRow(bufferRow)
|
||||
|
||||
foldSelection: ->
|
||||
selection.fold() for selection in @getSelections()
|
||||
|
||||
foldAll: ->
|
||||
@displayBuffer.foldAll()
|
||||
|
||||
toggleFold: ->
|
||||
bufferRow = @bufferPositionForScreenPosition(@getCursorScreenPosition()).row
|
||||
@toggleFoldAtBufferRow(bufferRow)
|
||||
|
||||
toggleFoldAtBufferRow: (bufferRow) ->
|
||||
@displayBuffer.toggleFoldAtBufferRow(bufferRow)
|
||||
|
||||
createFold: (startRow, endRow) ->
|
||||
@displayBuffer.createFold(startRow, endRow)
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class Editor extends View
|
||||
'newline-below': @insertNewlineBelow
|
||||
'toggle-soft-wrap': @toggleSoftWrap
|
||||
'fold-all': @foldAll
|
||||
'toggle-fold': @toggleFold
|
||||
'fold': @fold
|
||||
'fold-selection': @foldSelection
|
||||
'unfold': => @unfoldCurrentRow()
|
||||
'split-left': @splitLeft
|
||||
@@ -220,11 +220,11 @@ class Editor extends View
|
||||
undo: -> @activeEditSession.undo()
|
||||
redo: -> @activeEditSession.redo()
|
||||
createFold: (startRow, endRow) -> @activeEditSession.createFold(startRow, endRow)
|
||||
fold: -> @activeEditSession.fold()
|
||||
foldAll: -> @activeEditSession.foldAll()
|
||||
foldSelection: -> @activeEditSession.foldSelection()
|
||||
destroyFold: (foldId) -> @activeEditSession.destroyFold(foldId)
|
||||
destroyFoldsContainingBufferRow: (bufferRow) -> @activeEditSession.destroyFoldsContainingBufferRow(bufferRow)
|
||||
toggleFold: -> @activeEditSession.toggleFold()
|
||||
isFoldedAtScreenRow: (screenRow) -> @activeEditSession.isFoldedAtScreenRow(screenRow)
|
||||
unfoldCurrentRow: -> @activeEditSession.unfoldCurrentRow()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user