mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Fix bug where cursor occasionally precedes '/' after pressing meta-f
Now we always move cursor to end when setting the command panel's mini-editor text.
This commit is contained in:
@@ -97,10 +97,14 @@ describe "CommandPanel", ->
|
||||
expect(commandInterpreter.lastRelativeAddress.subcommands[0].regex.toString()).toEqual "/\\(items\\)/"
|
||||
|
||||
describe "when command-panel:find-in-file is triggered on an editor", ->
|
||||
it "pre-populates command panel's editor with /", ->
|
||||
it "pre-populates command panel's editor with / and moves the cursor to column 1", ->
|
||||
commandPanel.miniEditor.setText("foo")
|
||||
commandPanel.miniEditor.setCursorBufferPosition([0, 0])
|
||||
|
||||
rootView.getActiveEditor().trigger "command-panel:find-in-file"
|
||||
expect(commandPanel.parent).not.toBeEmpty()
|
||||
expect(commandPanel.miniEditor.getText()).toBe "/"
|
||||
expect(commandPanel.miniEditor.getCursorBufferPosition()).toEqual [0, 1]
|
||||
|
||||
describe "when esc is pressed in the command panel", ->
|
||||
it "closes the command panel", ->
|
||||
|
||||
@@ -63,6 +63,7 @@ class CommandPanel extends View
|
||||
@previewList.hide()
|
||||
@miniEditor.focus()
|
||||
@miniEditor.setText(text)
|
||||
@miniEditor.setCursorBufferPosition([0, Infinity])
|
||||
|
||||
detach: ->
|
||||
@rootView.focus()
|
||||
|
||||
Reference in New Issue
Block a user