mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Meta-shift-f opens the command panel pre-populated with Xx/ to find in project
This commit is contained in:
parent
73654a5e3f
commit
d16328c533
@ -108,6 +108,18 @@ describe "CommandPanel", ->
|
||||
expect(commandPanel.miniEditor.getText()).toBe "/"
|
||||
expect(commandPanel.miniEditor.getCursorBufferPosition()).toEqual [0, 1]
|
||||
|
||||
describe "when command-panel:find-in-project is triggered on the root view", ->
|
||||
it "pre-populates the command panel's editor with Xx/ and moves the cursor to the last column", ->
|
||||
spyOn(commandPanel, 'attach').andCallThrough()
|
||||
commandPanel.miniEditor.setText("foo")
|
||||
commandPanel.miniEditor.setCursorBufferPosition([0, 0])
|
||||
|
||||
rootView.trigger "command-panel:find-in-project"
|
||||
expect(commandPanel.attach).toHaveBeenCalled()
|
||||
expect(commandPanel.parent).not.toBeEmpty()
|
||||
expect(commandPanel.miniEditor.getText()).toBe "Xx/"
|
||||
expect(commandPanel.miniEditor.getCursorBufferPosition()).toEqual [0, 3]
|
||||
|
||||
describe "when esc is pressed in the command panel", ->
|
||||
it "closes the command panel", ->
|
||||
rootView.trigger 'command-panel:toggle'
|
||||
|
@ -47,6 +47,7 @@ class CommandPanel extends View
|
||||
@rootView.on 'command-panel:toggle', => @toggle()
|
||||
@rootView.on 'command-panel:execute', => @execute()
|
||||
@rootView.on 'command-panel:find-in-file', => @attach("/")
|
||||
@rootView.on 'command-panel:find-in-project', => @attach("Xx/")
|
||||
@rootView.on 'command-panel:repeat-relative-address', => @repeatRelativeAddress()
|
||||
@rootView.on 'command-panel:repeat-relative-address-in-reverse', => @repeatRelativeAddressInReverse()
|
||||
@rootView.on 'command-panel:set-selection-as-regex-address', => @setSelectionAsLastRelativeAddress()
|
||||
|
@ -10,3 +10,4 @@ window.keymap.bindKeys '.editor',
|
||||
'meta-G': 'command-panel:repeat-relative-address-in-reverse'
|
||||
'meta-e': 'command-panel:set-selection-as-regex-address'
|
||||
'meta-f': 'command-panel:find-in-file'
|
||||
'meta-F': 'command-panel:find-in-project'
|
||||
|
Loading…
Reference in New Issue
Block a user