mirror of
https://github.com/atom/atom.git
synced 2026-02-15 17:15:24 -05:00
Backspace in column 0 below a fold absorbs line into fold
This commit is contained in:
@@ -198,6 +198,9 @@ class EditSession
|
||||
destroyFoldsContainingBufferRow: (bufferRow) ->
|
||||
@renderer.destroyFoldsContainingBufferRow(bufferRow)
|
||||
|
||||
isFoldedAtScreenRow: (screenRow) ->
|
||||
@screenLineForRow(screenRow).fold?
|
||||
|
||||
toggleLineCommentsInRange: (range) ->
|
||||
@renderer.toggleLineCommentsInRange(range)
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ class Editor extends View
|
||||
@screenLineCount() - 1
|
||||
|
||||
isFoldedAtScreenRow: (screenRow) ->
|
||||
@screenLineForRow(screenRow).fold?
|
||||
@activeEditSession.isFoldedAtScreenRow(screenRow)
|
||||
|
||||
destroyFoldsContainingBufferRow: (bufferRow) ->
|
||||
@renderer.destroyFoldsContainingBufferRow(bufferRow)
|
||||
|
||||
@@ -86,6 +86,9 @@ class Selection
|
||||
selectToScreenPosition: (position) ->
|
||||
@modifySelection => @cursor.setScreenPosition(position)
|
||||
|
||||
selectToBufferPosition: (position) ->
|
||||
@modifySelection => @cursor.setBufferPosition(position)
|
||||
|
||||
selectRight: ->
|
||||
@modifySelection => @cursor.moveRight()
|
||||
|
||||
@@ -131,7 +134,13 @@ class Selection
|
||||
|
||||
backspace: ->
|
||||
@editSession.destroyFoldsContainingBufferRow(@getBufferRange().end.row)
|
||||
@selectLeft() if @isEmpty()
|
||||
|
||||
if @isEmpty()
|
||||
if @editSession.isFoldedAtScreenRow(@cursor.getCurrentScreenRow() - 1)
|
||||
@selectToBufferPosition([@cursor.getCurrentBufferRow() - 1, Infinity])
|
||||
else
|
||||
@selectLeft()
|
||||
|
||||
@deleteSelectedText()
|
||||
|
||||
backspaceToBeginningOfWord: ->
|
||||
|
||||
Reference in New Issue
Block a user