Skip to content

Commit 8bc2845

Browse files
committed
Remove the pane.retainFocusAfterFlip preference
1 parent 41e0263 commit 8bc2845

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

src/nls/root/strings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,6 @@ define({
776776
"DESCRIPTION_OPEN_USER_PREFS_IN_SECOND_PANE" : "false to open user preferences file in left/top pane",
777777
"DESCRIPTION_MERGE_PANES_WHEN_LAST_FILE_CLOSED" : "true to collapse panes after the last file from the pane is closed via pane header close button",
778778
"DESCRIPTION_SHOW_PANE_HEADER_BUTTONS" : "Toggle when to show the close and flip-view buttons on the header.",
779-
"DESCRIPTION_RETAIN_FOCUS_AFTER_FLIP" : "true to retain focus on the currently active pane, false to move focus to the new pane",
780779
"DEFAULT_PREFERENCES_JSON_HEADER_COMMENT" : "/*\n * This is a read-only file with the preferences supported\n * by {APP_NAME}.\n * Use this file as a reference to modify your preferences\n * file \"brackets.json\" opened in the other pane.\n * For more information on how to use preferences inside\n * {APP_NAME}, refer to the web page at https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#preferences\n */",
781780
"DEFAULT_PREFERENCES_JSON_DEFAULT" : "Default",
782781
"DESCRIPTION_PURE_CODING_SURFACE" : "true to enable code only mode and hide all other UI elements in {APP_NAME}"

src/view/Pane.js

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,6 @@ define(function (require, exports, module) {
192192
values: ["hover", "always", "never"]
193193
});
194194

195-
// Define retainFocusAfterFlip, which controls which pane gets focus after a pane
196-
// has been flipped.
197-
PreferencesManager.definePreference("pane.retainFocusAfterFlip", "boolean", false, {
198-
description: Strings.DESCRIPTION_RETAIN_FOCUS_AFTER_FLIP
199-
});
200-
201195
// Define mergePanesWhenLastFileClosed, which controls if a split view pane should be
202196
// closed when the last file is closed, skipping the "Open a file while this pane has focus"
203197
// step completely.
@@ -235,7 +229,6 @@ define(function (require, exports, module) {
235229
// Setup the container and the element we're inserting
236230
var self = this,
237231
showPaneHeaderButtonsPref = PreferencesManager.get("pane.showPaneHeaderButtons"),
238-
retainFocusAfterFlip = PreferencesManager.get("pane.retainFocusAfterFlip"),
239232
$el = $container.append(Mustache.render(paneTemplate, {id: id})).find("#" + id),
240233
$header = $el.find(".pane-header"),
241234
$headerText = $header.find(".pane-header-text"),
@@ -253,11 +246,6 @@ define(function (require, exports, module) {
253246
var otherPaneId = self.id === FIRST_PANE ? SECOND_PANE : FIRST_PANE;
254247
var otherPane = MainViewManager._getPane(otherPaneId);
255248

256-
// currently active pane is not necessarily self.id as just clicking the button does not
257-
// give focus to the pane. This way it is possible to flip multiple panes to the active one
258-
// without losing focus.
259-
var activePaneIdBeforeFlip = MainViewManager.getActivePaneId();
260-
261249
MainViewManager._moveView(self.id, otherPaneId, currentFile).always(function () {
262250
CommandManager.execute(Commands.FILE_OPEN, {fullPath: currentFile.fullPath,
263251
paneId: otherPaneId}).always(function () {
@@ -266,17 +254,8 @@ define(function (require, exports, module) {
266254

267255
// Defer the focusing until other focus events have occurred.
268256
setTimeout(function () {
269-
if (retainFocusAfterFlip) {
270-
// Focus has most likely changed: give it back to the original pane.
271-
var activePaneBeforeFlip = MainViewManager._getPane(activePaneIdBeforeFlip);
272-
activePaneBeforeFlip.focus();
273-
self._lastFocusedElement = activePaneBeforeFlip.$el[0];
274-
MainViewManager.setActivePaneId(activePaneIdBeforeFlip);
275-
} else {
276-
// Other pane already has focus: update the Active Pane Id too.
277-
MainViewManager.setActivePaneId(otherPaneId);
278-
self._lastFocusedElement = otherPane.$el[0];
279-
}
257+
MainViewManager.setActivePaneId(otherPaneId);
258+
self._lastFocusedElement = otherPane.$el[0];
280259
}, 1);
281260
});
282261
});

0 commit comments

Comments
 (0)