mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Alt-meta-f folds the current selection
This commit is contained in:
@@ -58,6 +58,7 @@ class Editor extends View
|
||||
'meta-z': 'undo'
|
||||
'meta-Z': 'redo'
|
||||
'alt-meta-w': 'toggle-soft-wrap'
|
||||
'alt-meta-f': 'fold-selection'
|
||||
|
||||
@on 'move-right', => @moveCursorRight()
|
||||
@on 'move-left', => @moveCursorLeft()
|
||||
@@ -76,6 +77,7 @@ class Editor extends View
|
||||
@on 'undo', => @undo()
|
||||
@on 'redo', => @redo()
|
||||
@on 'toggle-soft-wrap', => @toggleSoftWrap()
|
||||
@on 'fold-selection', => @foldSelection()
|
||||
|
||||
buildCursorAndSelection: ->
|
||||
@cursor = new Cursor(this)
|
||||
@@ -273,6 +275,8 @@ class Editor extends View
|
||||
copySelection: -> @selection.copy()
|
||||
paste: -> @selection.insertText(atom.native.readFromPasteboard())
|
||||
|
||||
foldSelection: -> @selection.fold()
|
||||
|
||||
backspace: ->
|
||||
@selectLeft() if @selection.isEmpty()
|
||||
@selection.delete()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Cursor = require 'cursor'
|
||||
|
||||
Range = require 'range'
|
||||
{View, $$} = require 'space-pen'
|
||||
|
||||
@@ -157,3 +158,6 @@ class Selection extends View
|
||||
return if @isEmpty()
|
||||
text = @editor.buffer.getTextInRange @getRange()
|
||||
atom.native.writeToPasteboard text
|
||||
|
||||
fold: ->
|
||||
@editor.lineFolder.createFold(@getRange())
|
||||
|
||||
Reference in New Issue
Block a user