mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
meta-alt-u unfolds lines at cursor
This commit is contained in:
parent
ed271fee0f
commit
a7d43c2cca
@ -2436,6 +2436,20 @@ describe "Editor", ->
|
||||
|
||||
expect(editor.getCursorBufferPosition()).toEqual [3, 0]
|
||||
|
||||
describe "when a cursor is on a fold placeholder line", ->
|
||||
it "removes the associated fold and places the cursor at its beginning", ->
|
||||
editor.getSelection().setBufferRange(new Range([3, 0], [9, 0]))
|
||||
editor.trigger 'fold-selection'
|
||||
|
||||
editor.setCursorBufferPosition([3,0])
|
||||
editor.trigger 'unfold'
|
||||
|
||||
expect(editor.find('.fold')).not.toExist()
|
||||
expect(editor.visibleLines.find('.line:eq(4)').text()).toMatch /4-+/
|
||||
expect(editor.visibleLines.find('.line:eq(5)').text()).toMatch /5/
|
||||
|
||||
expect(editor.getCursorBufferPosition()).toEqual [3, 0]
|
||||
|
||||
describe "editor-path-change event", ->
|
||||
it "emits event when buffer's path is changed", ->
|
||||
editor = new Editor
|
||||
|
@ -119,6 +119,7 @@ class Editor extends View
|
||||
'redo': @redo
|
||||
'toggle-soft-wrap': @toggleSoftWrap
|
||||
'fold-selection': @foldSelection
|
||||
'unfold': => @unfoldRow(@getCursorBufferPosition().row)
|
||||
'split-left': @splitLeft
|
||||
'split-right': @splitRight
|
||||
'split-up': @splitUp
|
||||
@ -681,6 +682,9 @@ class Editor extends View
|
||||
|
||||
foldSelection: -> @getSelection().fold()
|
||||
|
||||
unfoldRow: (row) ->
|
||||
@renderer.largestFoldForBufferRow(row)?.destroy()
|
||||
|
||||
undo: ->
|
||||
if ranges = @buffer.undo()
|
||||
@setSelectedBufferRanges(ranges)
|
||||
|
@ -28,6 +28,7 @@ window.keymap.bindKeys '.editor',
|
||||
'meta-Z': 'redo'
|
||||
'alt-meta-w': 'toggle-soft-wrap'
|
||||
'alt-meta-f': 'fold-selection'
|
||||
'alt-meta-u': 'unfold'
|
||||
'alt-meta-left': 'split-left'
|
||||
'alt-meta-right': 'split-right'
|
||||
'alt-meta-up': 'split-up'
|
||||
|
Loading…
Reference in New Issue
Block a user