@@ -1120,28 +1120,20 @@ define(function (require, exports, module) {
11201120
11211121 /**
11221122 * Edits a document in the specified pane.
1123- * This function is only used by Unit Tests (which construct Mock Documents),
1124- * The Deprecated API "setCurrentDocument" and by File > New
1125- * because there is yet to be an established File object for the Document which is required
1126- * for the open API.
1127- * Do not use this API unless you have a document object without a file object
1123+ * This function is only used by:
1124+ * - Unit Tests (which construct Mock Document objects),
1125+ * - by File > New because there is yet to be an established File object
1126+ * - by Find In Files which needs to open documents synchronously in some cases
1127+ * Do not use this API it is for internal use only
11281128 * @param {!string } paneId - id of the pane in which to open the document
11291129 * @param {!Document } doc - document to edit
1130- * @param {{noPaneActivate:boolean=, noPaneRedundancyCheck:boolean= }= } optionsIn - options
1130+ * @param {{noPaneActivate:boolean=}= } optionsIn - options
11311131 * @private
11321132 */
11331133 function _edit ( paneId , doc , optionsIn ) {
11341134 var options = optionsIn || { } ,
1135- currentPaneId ;
1135+ currentPaneId = _getPaneIdForPath ( doc . file . fullPath ) ;
11361136
1137- if ( options . noPaneRedundancyCheck ) {
1138- // This flag is for internal use only to improve performance
1139- // Don't check for the file to have been opened in another pane pane which could be time
1140- // consuming. should only be used when passing an actual paneId (not a special paneId)
1141- // and the caller has already done a redundancy check.
1142- currentPaneId = _getPaneIdForPath ( doc . file . fullPath ) ;
1143- }
1144-
11451137 if ( currentPaneId ) {
11461138 // If the doc is open in another pane then switch to that pane and call open document
11471139 // which will really just show the view as it has always done we could just
@@ -1172,7 +1164,7 @@ define(function (require, exports, module) {
11721164 * or a document for editing. If it's a document for editing, edit is called on the document
11731165 * @param {!string } paneId - id of the pane in which to open the document
11741166 * @param {!File } file - file to open
1175- * @param {{noPaneActivate:boolean=, noPaneRedundancyCheck:boolean= }= } optionsIn - options
1167+ * @param {{noPaneActivate:boolean=}= } optionsIn - options
11761168 * @return {jQuery.Promise } promise that resolves to a File object or
11771169 * rejects with a File error or string
11781170 */
@@ -1250,8 +1242,7 @@ define(function (require, exports, module) {
12501242 DocumentManager . getDocumentForPath ( file . fullPath )
12511243 . done ( function ( doc ) {
12521244 _edit ( paneId , doc , $ . extend ( { } , options , {
1253- noPaneActivate : true ,
1254- noPaneRedundancyCheck : true
1245+ noPaneActivate : true
12551246 } ) ) ;
12561247 doPostOpenActivation ( ) ;
12571248 result . resolve ( doc . file ) ;
0 commit comments