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

Commit 126f448

Browse files
committed
Merge remote-tracking branch 'origin/master' into randy/issue-6023
2 parents 7928570 + 31dee88 commit 126f448

136 files changed

Lines changed: 16066 additions & 1164 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.brackets.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"src/thirdparty/CodeMirror2/**/*.js": {
1212
"spaceUnits": 2,
1313
"linting.enabled": false
14+
},
15+
"src/thirdparty/globmatch.js": {
16+
"spaceUnits": 2,
17+
"linting.enabled": false
1418
}
1519
},
1620
"spaceUnits": 4,

src/base-config/keyboard.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@
6868
"edit.splitSelIntoLines": [
6969
"Ctrl-Alt-L"
7070
],
71-
"edit.addPrevLineToSel": [
71+
"edit.addCursorToPrevLine": [
7272
{
7373
"key": "Shift-Alt-Up",
7474
"displayKey": "Shift-Alt-↑"
7575
}
7676
],
77-
"edit.addNextLineToSel": [
77+
"edit.addCursorToNextLine": [
7878
{
7979
"key": "Shift-Alt-Down",
8080
"displayKey": "Shift-Alt-↓"
@@ -317,5 +317,8 @@
317317
],
318318
"file.rename": [
319319
"F2"
320+
],
321+
"help.support": [
322+
"F1"
320323
]
321324
}

src/brackets.config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
"about_icon" : "styles/images/brackets_icon.svg",
77
"update_info_url" : "http://dev.brackets.io/updates/stable/",
88
"how_to_use_url" : "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets",
9+
"support_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting",
10+
"suggest_feature_url" : "https://github.com/adobe/brackets/wiki/Suggest-a-Feature",
11+
"get_involved_url" : "https://github.com/adobe/brackets/blob/master/CONTRIBUTING.md",
912
"glob_help_url" : "https://github.com/adobe/brackets/wiki/Using-File-Filters",
10-
"forum_url" : "https://groups.google.com/forum/?fromgroups#!forum/brackets-dev",
1113
"release_notes_url" : "https://github.com/adobe/brackets/wiki/Release-Notes",
12-
"report_issue_url" : "https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue",
1314
"twitter_url" : "https://twitter.com/brackets",
1415
"troubleshoot_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev",
1516
"twitter_name" : "@brackets",

src/command/Commands.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ define(function (require, exports, module) {
7070

7171
exports.EDIT_SELECT_LINE = "edit.selectLine"; // EditorCommandHandlers.js selectLine()
7272
exports.EDIT_SPLIT_SEL_INTO_LINES = "edit.splitSelIntoLines"; // EditorCommandHandlers.js splitSelIntoLines()
73-
exports.EDIT_ADD_NEXT_LINE_TO_SEL = "edit.addNextLineToSel"; // EditorCommandHandlers.js addNextLineToSel()
74-
exports.EDIT_ADD_PREV_LINE_TO_SEL = "edit.addPrevLineToSel"; // EditorCommandHandlers.js addPrevLineToSel()
73+
exports.EDIT_ADD_CUR_TO_NEXT_LINE = "edit.addCursorToNextLine"; // EditorCommandHandlers.js addCursorToNextLine()
74+
exports.EDIT_ADD_CUR_TO_PREV_LINE = "edit.addCursorToPrevLine"; // EditorCommandHandlers.js addCursorToPrevLine()
7575
exports.EDIT_FIND = "edit.find"; // FindReplace.js _launchFind()
7676
exports.EDIT_FIND_IN_FILES = "edit.findInFiles"; // FindInFiles.js _doFindInFiles()
7777
exports.EDIT_FIND_IN_SUBTREE = "edit.findInSubtree"; // FindInFiles.js _doFindInSubtree()
@@ -91,7 +91,7 @@ define(function (require, exports, module) {
9191
exports.EDIT_LINE_DOWN = "edit.lineDown"; // EditorCommandHandlers.js moveLineDown()
9292
exports.EDIT_OPEN_LINE_ABOVE = "edit.openLineAbove"; // EditorCommandHandlers.js openLineAbove()
9393
exports.EDIT_OPEN_LINE_BELOW = "edit.openLineBelow"; // EditorCommandHandlers.js openLineBelow()
94-
exports.TOGGLE_CLOSE_BRACKETS = "edit.autoCloseBrackets"; // EditorOptionHandlers.js _toggleCloseBrackets()
94+
exports.TOGGLE_CLOSE_BRACKETS = "edit.autoCloseBrackets"; // EditorOptionHandlers.js _getToggler()
9595
exports.SHOW_CODE_HINTS = "edit.showCodeHints"; // CodeHintManager.js _startNewSession()
9696

9797
// VIEW
@@ -102,9 +102,9 @@ define(function (require, exports, module) {
102102
exports.VIEW_SCROLL_LINE_UP = "view.scrollLineUp"; // ViewCommandHandlers.js _handleScrollLineUp()
103103
exports.VIEW_SCROLL_LINE_DOWN = "view.scrollLineDown"; // ViewCommandHandlers.js _handleScrollLineDown()
104104
exports.VIEW_TOGGLE_INSPECTION = "view.toggleCodeInspection"; // CodeInspection.js toggleEnabled()
105-
exports.TOGGLE_LINE_NUMBERS = "view.toggleLineNumbers"; // EditorOptionHandlers.js _toggleLineNumbers()
106-
exports.TOGGLE_ACTIVE_LINE = "view.toggleActiveLine"; // EditorOptionHandlers.js _toggleActiveLine()
107-
exports.TOGGLE_WORD_WRAP = "view.toggleWordWrap"; // EditorOptionHandlers.js _toggleWordWrap()
105+
exports.TOGGLE_LINE_NUMBERS = "view.toggleLineNumbers"; // EditorOptionHandlers.js _getToggler()
106+
exports.TOGGLE_ACTIVE_LINE = "view.toggleActiveLine"; // EditorOptionHandlers.js _getToggler()
107+
exports.TOGGLE_WORD_WRAP = "view.toggleWordWrap"; // EditorOptionHandlers.js _getToggler()
108108
exports.SORT_WORKINGSET_BY_ADDED = "view.sortWorkingSetByAdded"; // WorkingSetSort.js _handleSortWorkingSetByAdded()
109109
exports.SORT_WORKINGSET_BY_NAME = "view.sortWorkingSetByName"; // WorkingSetSort.js _handleSortWorkingSetByName()
110110
exports.SORT_WORKINGSET_BY_TYPE = "view.sortWorkingSetByType"; // WorkingSetSort.js _handleSortWorkingSetByType()
@@ -129,9 +129,10 @@ define(function (require, exports, module) {
129129
// HELP
130130
exports.HELP_CHECK_FOR_UPDATE = "help.checkForUpdate"; // HelpCommandHandlers.js _handleCheckForUpdates()
131131
exports.HELP_HOW_TO_USE_BRACKETS = "help.howToUseBrackets"; // HelpCommandHandlers.js _handleLinkMenuItem()
132-
exports.HELP_FORUM = "help.forum"; // HelpCommandHandlers.js _handleLinkMenuItem()
132+
exports.HELP_SUPPORT = "help.support"; // HelpCommandHandlers.js _handleLinkMenuItem()
133+
exports.HELP_SUGGEST = "help.suggest"; // HelpCommandHandlers.js _handleLinkMenuItem()
133134
exports.HELP_RELEASE_NOTES = "help.releaseNotes"; // HelpCommandHandlers.js _handleLinkMenuItem()
134-
exports.HELP_REPORT_AN_ISSUE = "help.reportAnIssue"; // HelpCommandHandlers.js _handleLinkMenuItem()
135+
exports.HELP_GET_INVOLVED = "help.getInvolved"; // HelpCommandHandlers.js _handleLinkMenuItem()
135136
exports.HELP_SHOW_EXT_FOLDER = "help.showExtensionsFolder"; // HelpCommandHandlers.js _handleShowExtensionsFolder()
136137
exports.HELP_TWITTER = "help.twitter"; // HelpCommandHandlers.js _handleLinkMenuItem()
137138

src/command/DefaultMenus.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ define(function (require, exports, module) {
7979
menu.addMenuItem(Commands.EDIT_SELECT_ALL);
8080
menu.addMenuItem(Commands.EDIT_SELECT_LINE);
8181
menu.addMenuItem(Commands.EDIT_SPLIT_SEL_INTO_LINES);
82-
menu.addMenuItem(Commands.EDIT_ADD_PREV_LINE_TO_SEL);
83-
menu.addMenuItem(Commands.EDIT_ADD_NEXT_LINE_TO_SEL);
82+
menu.addMenuItem(Commands.EDIT_ADD_CUR_TO_PREV_LINE);
83+
menu.addMenuItem(Commands.EDIT_ADD_CUR_TO_NEXT_LINE);
8484
menu.addMenuDivider();
8585
menu.addMenuItem(Commands.EDIT_FIND);
8686
menu.addMenuItem(Commands.EDIT_FIND_IN_FILES);
@@ -157,14 +157,17 @@ define(function (require, exports, module) {
157157
if (brackets.config.how_to_use_url) {
158158
menu.addMenuItem(Commands.HELP_HOW_TO_USE_BRACKETS);
159159
}
160-
if (brackets.config.forum_url) {
161-
menu.addMenuItem(Commands.HELP_FORUM);
160+
if (brackets.config.support_url) {
161+
menu.addMenuItem(Commands.HELP_SUPPORT);
162+
}
163+
if (brackets.config.suggest_feature_url) {
164+
menu.addMenuItem(Commands.HELP_SUGGEST);
162165
}
163166
if (brackets.config.release_notes_url) {
164167
menu.addMenuItem(Commands.HELP_RELEASE_NOTES);
165168
}
166-
if (brackets.config.report_issue_url) {
167-
menu.addMenuItem(Commands.HELP_REPORT_AN_ISSUE);
169+
if (brackets.config.get_involved_url) {
170+
menu.addMenuItem(Commands.HELP_GET_INVOLVED);
168171
}
169172

170173
menu.addMenuDivider();

src/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"about_icon": "styles/images/brackets_icon.svg",
66
"update_info_url": "http://dev.brackets.io/updates/stable/",
77
"how_to_use_url": "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets",
8+
"support_url": "https://github.com/adobe/brackets/wiki/Troubleshooting",
9+
"suggest_feature_url": "https://github.com/adobe/brackets/wiki/Suggest-a-Feature",
10+
"get_involved_url": "https://github.com/adobe/brackets/blob/master/CONTRIBUTING.md",
811
"glob_help_url": "https://github.com/adobe/brackets/wiki/Using-File-Filters",
9-
"forum_url": "https://groups.google.com/forum/?fromgroups#!forum/brackets-dev",
1012
"release_notes_url": "https://github.com/adobe/brackets/wiki/Release-Notes",
11-
"report_issue_url": "https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue",
1213
"twitter_url": "https://twitter.com/brackets",
1314
"troubleshoot_url": "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev",
1415
"twitter_name": "@brackets",

src/document/Document.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ define(function (require, exports, module) {
107107
*/
108108
Document.prototype.isDirty = false;
109109

110+
/**
111+
* Whether this document is currently being saved.
112+
* @type {boolean}
113+
*/
114+
Document.prototype.isSaving = false;
115+
110116
/**
111117
* What we expect the file's timestamp to be on disk. If the timestamp differs from this, then
112118
* it means the file was modified by an app other than Brackets.

src/document/DocumentCommandHandlers.js

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ define(function (require, exports, module) {
261261
var file = FileSystem.getFileForPath(fullPath);
262262
file.exists(function (fileError, fileExists) {
263263
if (fileExists) {
264-
EditorManager.showCustomViewer(viewProvider, fullPath);
264+
EditorManager._showCustomViewer(viewProvider, fullPath);
265265
result.resolve();
266266
} else {
267267
fileError = fileError || FileSystemError.NOT_FOUND;
@@ -750,31 +750,39 @@ define(function (require, exports, module) {
750750
return;
751751
}
752752

753+
doc.isSaving = true; // mark that we're saving the document
754+
753755
// First, write document's current text to new file
754756
newFile = FileSystem.getFileForPath(path);
755757

756758
// Save as warns you when you're about to overwrite a file, so we
757759
// explictly allow "blind" writes to the filesystem in this case,
758760
// ignoring warnings about the contents being modified outside of
759761
// the editor.
760-
FileUtils.writeText(newFile, doc.getText(), true).done(function () {
761-
// If there were unsaved changes before Save As, they don't stay with the old
762-
// file anymore - so must revert the old doc to match disk content.
763-
// Only do this if the doc was dirty: doRevert on a file that is not dirty and
764-
// not in the working set has the side effect of adding it to the working set.
765-
if (doc.isDirty && !(doc.isUntitled())) {
766-
// if the file is dirty it must be in the working set
767-
// doRevert is side effect free in this case
768-
doRevert(doc).always(openNewFile);
769-
} else {
770-
openNewFile();
771-
}
772-
}).fail(function (error) {
773-
_showSaveFileError(error, path)
774-
.done(function () {
775-
result.reject(error);
776-
});
777-
});
762+
FileUtils.writeText(newFile, doc.getText(), true)
763+
.done(function () {
764+
// If there were unsaved changes before Save As, they don't stay with the old
765+
// file anymore - so must revert the old doc to match disk content.
766+
// Only do this if the doc was dirty: doRevert on a file that is not dirty and
767+
// not in the working set has the side effect of adding it to the working set.
768+
if (doc.isDirty && !(doc.isUntitled())) {
769+
// if the file is dirty it must be in the working set
770+
// doRevert is side effect free in this case
771+
doRevert(doc).always(openNewFile);
772+
} else {
773+
openNewFile();
774+
}
775+
})
776+
.fail(function (error) {
777+
_showSaveFileError(error, path)
778+
.done(function () {
779+
result.reject(error);
780+
});
781+
})
782+
.always(function () {
783+
// mark that we're done saving the document
784+
doc.isSaving = false;
785+
});
778786
}
779787

780788
if (doc) {
@@ -823,7 +831,7 @@ define(function (require, exports, module) {
823831
doc = (commandData && commandData.doc) || activeDoc,
824832
settings;
825833

826-
if (doc) {
834+
if (doc && !doc.isSaving) {
827835
if (doc.isUntitled()) {
828836
if (doc === activeDoc) {
829837
settings = {
@@ -983,7 +991,7 @@ define(function (require, exports, module) {
983991
result.resolve();
984992
});
985993
} else {
986-
EditorManager.closeCustomViewer();
994+
EditorManager._closeCustomViewer();
987995
result.resolve();
988996
}
989997
}
@@ -1194,15 +1202,15 @@ define(function (require, exports, module) {
11941202
return _closeList(DocumentManager.getWorkingSet(),
11951203
(commandData && commandData.promptOnly), true).done(function () {
11961204
if (!DocumentManager.getCurrentDocument()) {
1197-
EditorManager.closeCustomViewer();
1205+
EditorManager._closeCustomViewer();
11981206
}
11991207
});
12001208
}
12011209

12021210
function handleFileCloseList(commandData) {
12031211
return _closeList(commandData.fileList, false, false).done(function () {
12041212
if (!DocumentManager.getCurrentDocument()) {
1205-
EditorManager.closeCustomViewer();
1213+
EditorManager._closeCustomViewer();
12061214
}
12071215
});
12081216
}
@@ -1466,6 +1474,12 @@ define(function (require, exports, module) {
14661474
Menus.removeMenu(key);
14671475
});
14681476

1477+
// If there's a fragment in both URLs, setting location.href won't actually reload
1478+
var fragment = href.indexOf("#");
1479+
if (fragment !== -1) {
1480+
href = href.substr(0, fragment);
1481+
}
1482+
14691483
window.location.href = href;
14701484
});
14711485
}).fail(function () {
@@ -1560,9 +1574,6 @@ define(function (require, exports, module) {
15601574
// Register global commands
15611575
CommandManager.register(Strings.CMD_FILE_OPEN, Commands.FILE_OPEN, handleFileOpen);
15621576
CommandManager.register(Strings.CMD_ADD_TO_WORKING_SET, Commands.FILE_ADD_TO_WORKING_SET, handleFileAddToWorkingSet);
1563-
// TODO: (issue #274) For now, hook up File > New to the "new in project" handler. Eventually
1564-
// File > New should open a new blank tab, and handleFileNewInProject should
1565-
// be called from a "+" button in the project
15661577
CommandManager.register(Strings.CMD_FILE_NEW_UNTITLED, Commands.FILE_NEW_UNTITLED, handleFileNew);
15671578
CommandManager.register(Strings.CMD_FILE_NEW, Commands.FILE_NEW, handleFileNewInProject);
15681579
CommandManager.register(Strings.CMD_FILE_NEW_FOLDER, Commands.FILE_NEW_FOLDER, handleNewFolderInProject);

0 commit comments

Comments
 (0)