diff --git a/src/command/Commands.js b/src/command/Commands.js index 6e087cd54e5..95d67dba21e 100644 --- a/src/command/Commands.js +++ b/src/command/Commands.js @@ -77,7 +77,7 @@ define(function (require, exports, module) { // Navigate exports.NAVIGATE_NEXT_DOC = "navigate.nextDoc"; exports.NAVIGATE_PREV_DOC = "navigate.prevDoc"; - exports.NAVIGATE_SHOW_IN_TREE = "navigate.showInTree"; + exports.NAVIGATE_SHOW_IN_FILE_TREE = "navigate.showInFileTree"; exports.NAVIGATE_QUICK_OPEN = "navigate.quickOpen"; exports.NAVIGATE_GOTO_DEFINITION = "navigate.gotoDefinition"; exports.NAVIGATE_GOTO_LINE = "navigate.gotoLine"; diff --git a/src/command/Menus.js b/src/command/Menus.js index 3eaa7c7bbcf..9130cdc743d 100644 --- a/src/command/Menus.js +++ b/src/command/Menus.js @@ -921,7 +921,7 @@ define(function (require, exports, module) { menu.addMenuItem(Commands.NAVIGATE_PREV_DOC, [{key: "Ctrl-Shift-Tab", platform: "win"}, {key: "Ctrl-Shift-Tab", platform: "mac"}]); menu.addMenuDivider(); - menu.addMenuItem(Commands.NAVIGATE_SHOW_IN_TREE); + menu.addMenuItem(Commands.NAVIGATE_SHOW_IN_FILE_TREE); menu.addMenuDivider(); menu.addMenuItem(Commands.TOGGLE_QUICK_EDIT, "Ctrl-E"); menu.addMenuItem(Commands.QUICK_EDIT_PREV_MATCH, {key: "Alt-Up", displayKey: "Alt-\u2191"}); diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 873ca9c2a5b..0945e93721f 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -848,7 +848,7 @@ define(function (require, exports, module) { CommandManager.register(Strings.CMD_NEXT_DOC, Commands.NAVIGATE_NEXT_DOC, handleGoNextDoc); CommandManager.register(Strings.CMD_PREV_DOC, Commands.NAVIGATE_PREV_DOC, handleGoPrevDoc); - CommandManager.register(Strings.CMD_SHOW_IN_TREE, Commands.NAVIGATE_SHOW_IN_TREE, handleShowInTree); + CommandManager.register(Strings.CMD_SHOW_IN_TREE, Commands.NAVIGATE_SHOW_IN_FILE_TREE, handleShowInTree); // Listen for changes that require updating the editor titlebar $(DocumentManager).on("dirtyFlagChange", handleDirtyChange); diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 9f683024953..fe70fdbd498 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -195,7 +195,7 @@ define({ "CMD_QUICK_EDIT_NEXT_MATCH" : "Next Match", "CMD_NEXT_DOC" : "Next Document", "CMD_PREV_DOC" : "Previous Document", - "CMD_SHOW_IN_TREE" : "Show in Tree", + "CMD_SHOW_IN_TREE" : "Show in File Tree", // Debug menu commands "DEBUG_MENU" : "Debug", diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index db77dc97f77..e6096a2e7e9 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -776,15 +776,16 @@ define(function (require, exports, module) { * @return {$.Promise} Resolved with jQ obj for the jsTree tree node; or rejected if not found */ function _findTreeNode(entry) { - var projRelativePath = makeProjectRelativeIfPossible(entry.fullPath); - var treeAPI = $.jstree._reference(_projectTree); var result = new $.Deferred(); // If path not within project, ignore + var projRelativePath = makeProjectRelativeIfPossible(entry.fullPath); if (projRelativePath === entry.fullPath) { - return null; + return result.reject().promise(); } + var treeAPI = $.jstree._reference(_projectTree); + // We're going to traverse from root of tree, one segment at a time var pathSegments = projRelativePath.split("/");