@@ -244,12 +244,13 @@ define(function (require, exports, module) {
244244 * @param {!string } fullPath
245245 * @param {boolean= } silent If true, don't show error message
246246 * @param {string= } paneId, the id oi the pane in which to open the file. Can be undefined, a valid pane id or ACTIVE_PANE.
247+ * @param {{*}= } options, command options
247248 * @return {$.Promise } a jQuery promise that will either
248249 * - be resolved with a file for the specified file path or
249250 * - be rejected with FileSystemError if the file can not be read.
250251 * If paneId is undefined, the ACTIVE_PANE constant
251252 */
252- function _doOpen ( fullPath , silent , paneId ) {
253+ function _doOpen ( fullPath , silent , paneId , options ) {
253254 var result = new $ . Deferred ( ) ;
254255
255256 // workaround for https://github.com/adobe/brackets/issues/6001
@@ -288,7 +289,7 @@ define(function (require, exports, module) {
288289 } ) ;
289290
290291 var file = FileSystem . getFileForPath ( fullPath ) ;
291- MainViewManager . _open ( paneId , file )
292+ MainViewManager . _open ( paneId , file , options )
292293 . done ( function ( ) {
293294 result . resolve ( file ) ;
294295 } )
@@ -314,10 +315,11 @@ define(function (require, exports, module) {
314315 * @param {?string } fullPath - The path of the file to open; if it's null we'll prompt for it
315316 * @param {boolean= } silent - If true, don't show error message
316317 * @param {string= } paneId - the pane in which to open the file. Can be undefined, a valid pane id or ACTIVE_PANE
318+ * @param {{*}= } options - options to pass to MainViewManager._open
317319 * @return {$.Promise } a jQuery promise resolved with a Document object or
318320 * rejected with an err
319321 */
320- function _doOpenWithOptionalPath ( fullPath , silent , paneId ) {
322+ function _doOpenWithOptionalPath ( fullPath , silent , paneId , options ) {
321323 var result ;
322324 paneId = paneId || MainViewManager . ACTIVE_PANE ;
323325 if ( ! fullPath ) {
@@ -341,7 +343,7 @@ define(function (require, exports, module) {
341343 } ) ;
342344 MainViewManager . addListToWorkingSet ( paneId , filesToOpen ) ;
343345
344- _doOpen ( paths [ paths . length - 1 ] , silent , paneId )
346+ _doOpen ( paths [ paths . length - 1 ] , silent , paneId , options )
345347 . done ( function ( file ) {
346348 _defaultOpenDialogFullPath =
347349 FileUtils . getDirectoryPath (
@@ -357,7 +359,7 @@ define(function (require, exports, module) {
357359 }
358360 } ) ;
359361 } else {
360- result = _doOpen ( fullPath , silent , paneId ) ;
362+ result = _doOpen ( fullPath , silent , paneId , options ) ;
361363 }
362364
363365 return result . promise ( ) ;
@@ -414,9 +416,11 @@ define(function (require, exports, module) {
414416 paneId = ( commandData && commandData . paneId ) || MainViewManager . ACTIVE_PANE ,
415417 result = new $ . Deferred ( ) ;
416418
417- _doOpenWithOptionalPath ( fileInfo . path , silent , paneId )
419+ _doOpenWithOptionalPath ( fileInfo . path , silent , paneId , commandData && commandData . options )
418420 . done ( function ( file ) {
419- MainViewManager . setActivePaneId ( paneId ) ;
421+ if ( ! commandData || ! commandData . options || ! commandData . options . noPaneActivate ) {
422+ MainViewManager . setActivePaneId ( paneId ) ;
423+ }
420424
421425 // If a line and column number were given, position the editor accordingly.
422426 if ( fileInfo . line !== null ) {
0 commit comments