mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge branch 'focus-editor-when-selecting-tab' into dev
This commit is contained in:
@@ -708,7 +708,7 @@ class Editor extends View
|
||||
"Your changes will be lost if you don't save them"
|
||||
"Save", => @save(session, callback),
|
||||
"Cancel", null
|
||||
"Don't save", callback
|
||||
"Don't Save", callback
|
||||
)
|
||||
|
||||
remove: (selector, keepData) ->
|
||||
|
||||
@@ -75,6 +75,14 @@ describe "Tabs", ->
|
||||
tabs.find('.tab:eq(1)').click()
|
||||
expect(editor.getActiveEditSessionIndex()).toBe 1
|
||||
|
||||
it "focuses the associated editor", ->
|
||||
rootView.attachToDom()
|
||||
expect(editor).toMatchSelector ":has(:focus)"
|
||||
editor.splitRight()
|
||||
expect(editor).not.toMatchSelector ":has(:focus)"
|
||||
tabs.find('.tab:eq(0)').click()
|
||||
expect(editor).toMatchSelector ":has(:focus)"
|
||||
|
||||
describe "when a file name associated with a tab changes", ->
|
||||
[buffer, oldPath, newPath] = []
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ class Tabs extends View
|
||||
|
||||
@on 'click', '.tab', (e) =>
|
||||
@editor.setActiveEditSessionIndex($(e.target).closest('.tab').index())
|
||||
@editor.focus()
|
||||
|
||||
@on 'click', '.tab .close-icon', (e) =>
|
||||
index = $(e.target).closest('.tab').index()
|
||||
|
||||
Reference in New Issue
Block a user