mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
CommandPanel escapes characters with a backslash in front of them
This commit is contained in:
@@ -407,3 +407,8 @@ describe "CommandPanel", ->
|
||||
expect(editSession.buffer.getPath()).toBe project.resolve(operation.getPath())
|
||||
expect(editSession.getSelectedBufferRange()).toEqual operation.getBufferRange()
|
||||
expect(rootView.focus).toHaveBeenCalled()
|
||||
|
||||
describe ".escapedCommand()", ->
|
||||
it "escapes characters with a backslash in front of them", ->
|
||||
commandPanel.miniEditor.setText("a\\tb")
|
||||
expect(commandPanel.escapedCommand()).toBe("a\tb")
|
||||
|
||||
@@ -102,7 +102,10 @@ class CommandPanel extends View
|
||||
@previewList.hide()
|
||||
super
|
||||
|
||||
execute: (command = @miniEditor.getText()) ->
|
||||
escapedCommand: ->
|
||||
@miniEditor.getText().replace /\\(.)/, (match, charachter) -> eval("'\\#{charachter}'")
|
||||
|
||||
execute: (command=@escapedCommand())->
|
||||
try
|
||||
@commandInterpreter.eval(command, @rootView.getActiveEditSession()).done (operationsToPreview) =>
|
||||
@history.push(command)
|
||||
|
||||
Reference in New Issue
Block a user