mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Don't create folds for empty ranges
This commit is contained in:
@@ -628,8 +628,9 @@ class Selection extends Model
|
||||
# Public: Creates a fold containing the current selection.
|
||||
fold: ->
|
||||
range = @getBufferRange()
|
||||
@editor.foldBufferRange(range)
|
||||
@cursor.setBufferPosition(range.end)
|
||||
unless range.isEmpty()
|
||||
@editor.foldBufferRange(range)
|
||||
@cursor.setBufferPosition(range.end)
|
||||
|
||||
# Private: Increase the indentation level of the given text by given number
|
||||
# of levels. Leaves the first line unchanged.
|
||||
|
||||
Reference in New Issue
Block a user