Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Fix #9975.
Browse files Browse the repository at this point in the history
  • Loading branch information
busykai committed Nov 26, 2014
1 parent e411da0 commit 9afe56c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,24 @@ define(function (require, exports, module) {
PerfUtils.addMeasurement("Application Startup");

if (PreferencesManager._isUserScopeCorrupt()) {
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_ERROR,
Strings.ERROR_PREFS_CORRUPT_TITLE,
Strings.ERROR_PREFS_CORRUPT
)
var userPrefFullPath = PreferencesManager.getUserPrefFile();
// user scope can get corrupt only if the file exists, is readable,
// but malformed. no need to check for its existance.
var info = MainViewManager.findInAllWorkingSets(userPrefFullPath);
var paneId;
if (info.length) {
paneId = info[0].paneId;
}
FileViewController.openFileAndAddToWorkingSet(userPrefFullPath, paneId)
.done(function () {
CommandManager.execute(Commands.FILE_OPEN_PREFERENCES);
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_ERROR,
Strings.ERROR_PREFS_CORRUPT_TITLE,
Strings.ERROR_PREFS_CORRUPT
).done(function () {
// give the focus back to the editor with the pref file
MainViewManager.focusActivePane();
});
});
}

Expand Down

0 comments on commit 9afe56c

Please sign in to comment.