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

Commit 72aa412

Browse files
committed
Merge remote-tracking branch 'origin/master' into pflynn/better-quicksearch-field
2 parents 210a282 + a209bb7 commit 72aa412

74 files changed

Lines changed: 1538 additions & 334 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.

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
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" : "http://help.brackets.io",
10+
"get_involved_url" : "https://github.com/adobe/brackets",
911
"glob_help_url" : "https://github.com/adobe/brackets/wiki/Using-File-Filters",
10-
"forum_url" : "https://groups.google.com/forum/?fromgroups#!forum/brackets-dev",
1112
"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",
1313
"twitter_url" : "https://twitter.com/brackets",
1414
"troubleshoot_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev",
1515
"twitter_name" : "@brackets",

src/command/Commands.js

Lines changed: 8 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,9 @@ 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()
133133
exports.HELP_RELEASE_NOTES = "help.releaseNotes"; // HelpCommandHandlers.js _handleLinkMenuItem()
134-
exports.HELP_REPORT_AN_ISSUE = "help.reportAnIssue"; // HelpCommandHandlers.js _handleLinkMenuItem()
134+
exports.HELP_GET_INVOLVED = "help.getInvolved"; // HelpCommandHandlers.js _handleLinkMenuItem()
135135
exports.HELP_SHOW_EXT_FOLDER = "help.showExtensionsFolder"; // HelpCommandHandlers.js _handleShowExtensionsFolder()
136136
exports.HELP_TWITTER = "help.twitter"; // HelpCommandHandlers.js _handleLinkMenuItem()
137137

src/command/DefaultMenus.js

Lines changed: 6 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,14 @@ 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);
162162
}
163163
if (brackets.config.release_notes_url) {
164164
menu.addMenuItem(Commands.HELP_RELEASE_NOTES);
165165
}
166-
if (brackets.config.report_issue_url) {
167-
menu.addMenuItem(Commands.HELP_REPORT_AN_ISSUE);
166+
if (brackets.config.get_involved_url) {
167+
menu.addMenuItem(Commands.HELP_GET_INVOLVED);
168168
}
169169

170170
menu.addMenuDivider();

src/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
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": "http://help.brackets.io",
9+
"get_involved_url": "https://github.com/adobe/brackets",
810
"glob_help_url": "https://github.com/adobe/brackets/wiki/Using-File-Filters",
9-
"forum_url": "https://groups.google.com/forum/?fromgroups#!forum/brackets-dev",
1011
"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",
1212
"twitter_url": "https://twitter.com/brackets",
1313
"troubleshoot_url": "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev",
1414
"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: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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 = {
@@ -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);

src/editor/CSSInlineEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ define(function (require, exports, module) {
121121
*/
122122
function _addRule(selectorName, inlineEditor, path) {
123123
DocumentManager.getDocumentForPath(path).done(function (styleDoc) {
124-
var newRuleInfo = CSSUtils.addRuleToDocument(styleDoc, selectorName, Editor.getUseTabChar(), Editor.getSpaceUnits());
124+
var newRuleInfo = CSSUtils.addRuleToDocument(styleDoc, selectorName, Editor.getUseTabChar(path), Editor.getSpaceUnits(path));
125125
inlineEditor.addAndSelectRange(selectorName, styleDoc, newRuleInfo.range.from.line, newRuleInfo.range.to.line);
126126
inlineEditor.editor.setCursorPos(newRuleInfo.pos.line, newRuleInfo.pos.ch);
127127
});

0 commit comments

Comments
 (0)