File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/docmanager-extension/src Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -596,8 +596,17 @@ function addCommands(
596596 commands . addCommand ( CommandIDs . showInFileBrowser , {
597597 label : ( ) => `Show in File Browser` ,
598598 isEnabled,
599- execute : args => {
599+ execute : ( args , target ) => {
600+ // give 1st precedence to explicitly passed path
600601 let path = args [ 'path' ] ;
602+ if ( ! path && target ) {
603+ // give 2nd precedence to path on the target node, if present
604+ path = target . dataset [ 'path' ] ;
605+ }
606+ if ( ! path ) {
607+ // fall back to path of focused widget
608+ path = docManager . contextForWidget ( shell . currentWidget ) . path ;
609+ }
601610 if ( ! path ) {
602611 return ;
603612 }
@@ -634,7 +643,6 @@ function addCommands(
634643 } ) ;
635644 app . contextMenu . addItem ( {
636645 command : CommandIDs . showInFileBrowser ,
637- passDataset : true ,
638646 selector : '[data-type="document-title"]' ,
639647 rank : 3
640648 } ) ;
You can’t perform that action at this time.
0 commit comments