@@ -594,15 +594,19 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
594594 if ( _selectedUnstaged . Count == 1 )
595595 {
596596 var change = _selectedUnstaged [ 0 ] ;
597- var path = Path . GetFullPath ( Path . Combine ( _repo . FullPath , change . Path ) ) ;
597+ var path = Native . OS . GetAbsPath ( _repo . FullPath , change . Path ) ;
598598
599599 var explore = new MenuItem ( ) ;
600600 explore . Header = App . Text ( "RevealFile" ) ;
601601 explore . Icon = App . CreateMenuIcon ( "Icons.Explore" ) ;
602602 explore . IsEnabled = File . Exists ( path ) || Directory . Exists ( path ) ;
603603 explore . Click += ( _ , e ) =>
604604 {
605- Native . OS . OpenInFileManager ( path , true ) ;
605+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
606+ Native . OS . OpenInFileManager ( path , true ) ;
607+ else
608+ Native . OS . OpenInFileManager ( Native . OS . GetAbsPath ( _repo . FullPath , selectedSingleFolder ) , true ) ;
609+
606610 e . Handled = true ;
607611 } ;
608612 menu . Items . Add ( explore ) ;
@@ -982,7 +986,11 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
982986 copy . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
983987 copy . Click += ( _ , e ) =>
984988 {
985- App . CopyText ( change . Path ) ;
989+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
990+ App . CopyText ( change . Path ) ;
991+ else
992+ App . CopyText ( selectedSingleFolder ) ;
993+
986994 e . Handled = true ;
987995 } ;
988996 menu . Items . Add ( copy ) ;
@@ -992,7 +1000,11 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
9921000 copyFullPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
9931001 copyFullPath . Click += ( _ , e ) =>
9941002 {
995- App . CopyText ( Native . OS . GetAbsPath ( _repo . FullPath , change . Path ) ) ;
1003+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
1004+ App . CopyText ( path ) ;
1005+ else
1006+ App . CopyText ( Native . OS . GetAbsPath ( _repo . FullPath , selectedSingleFolder ) ) ;
1007+
9961008 e . Handled = true ;
9971009 } ;
9981010 menu . Items . Add ( copyFullPath ) ;
@@ -1154,6 +1166,27 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
11541166
11551167 menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
11561168 menu . Items . Add ( addToIgnore ) ;
1169+
1170+ var copy = new MenuItem ( ) ;
1171+ copy . Header = App . Text ( "CopyPath" ) ;
1172+ copy . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
1173+ copy . Click += ( _ , e ) =>
1174+ {
1175+ App . CopyText ( selectedSingleFolder ) ;
1176+ e . Handled = true ;
1177+ } ;
1178+
1179+ var copyFullPath = new MenuItem ( ) ;
1180+ copyFullPath . Header = App . Text ( "CopyPath" ) ;
1181+ copyFullPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
1182+ copyFullPath . Click += ( _ , e ) =>
1183+ {
1184+ App . CopyText ( Native . OS . GetAbsPath ( _repo . FullPath , selectedSingleFolder ) ) ;
1185+ e . Handled = true ;
1186+ } ;
1187+ menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
1188+ menu . Items . Add ( copy ) ;
1189+ menu . Items . Add ( copyFullPath ) ;
11571190 }
11581191 }
11591192
@@ -1205,15 +1238,19 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
12051238 if ( _selectedStaged . Count == 1 )
12061239 {
12071240 var change = _selectedStaged [ 0 ] ;
1208- var path = Path . GetFullPath ( Path . Combine ( _repo . FullPath , change . Path ) ) ;
1241+ var path = Native . OS . GetAbsPath ( _repo . FullPath , change . Path ) ;
12091242
12101243 var explore = new MenuItem ( ) ;
12111244 explore . IsEnabled = File . Exists ( path ) || Directory . Exists ( path ) ;
12121245 explore . Header = App . Text ( "RevealFile" ) ;
12131246 explore . Icon = App . CreateMenuIcon ( "Icons.Explore" ) ;
12141247 explore . Click += ( _ , e ) =>
12151248 {
1216- Native . OS . OpenInFileManager ( path , true ) ;
1249+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
1250+ Native . OS . OpenInFileManager ( path , true ) ;
1251+ else
1252+ Native . OS . OpenInFileManager ( Native . OS . GetAbsPath ( _repo . FullPath , selectedSingleFolder ) , true ) ;
1253+
12171254 e . Handled = true ;
12181255 } ;
12191256
@@ -1391,7 +1428,11 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
13911428 copyPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
13921429 copyPath . Click += ( _ , e ) =>
13931430 {
1394- App . CopyText ( change . Path ) ;
1431+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
1432+ App . CopyText ( change . Path ) ;
1433+ else
1434+ App . CopyText ( selectedSingleFolder ) ;
1435+
13951436 e . Handled = true ;
13961437 } ;
13971438
@@ -1400,7 +1441,11 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
14001441 copyFullPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
14011442 copyFullPath . Click += ( _ , e ) =>
14021443 {
1403- App . CopyText ( Native . OS . GetAbsPath ( _repo . FullPath , change . Path ) ) ;
1444+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
1445+ App . CopyText ( path ) ;
1446+ else
1447+ App . CopyText ( Native . OS . GetAbsPath ( _repo . FullPath , selectedSingleFolder ) ) ;
1448+
14041449 e . Handled = true ;
14051450 } ;
14061451
@@ -1480,6 +1525,31 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
14801525 menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
14811526 menu . Items . Add ( ai ) ;
14821527 }
1528+
1529+ if ( ! string . IsNullOrEmpty ( selectedSingleFolder ) )
1530+ {
1531+ var copyPath = new MenuItem ( ) ;
1532+ copyPath . Header = App . Text ( "CopyPath" ) ;
1533+ copyPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
1534+ copyPath . Click += ( _ , e ) =>
1535+ {
1536+ App . CopyText ( selectedSingleFolder ) ;
1537+ e . Handled = true ;
1538+ } ;
1539+
1540+ var copyFullPath = new MenuItem ( ) ;
1541+ copyFullPath . Header = App . Text ( "CopyFullPath" ) ;
1542+ copyFullPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
1543+ copyFullPath . Click += ( _ , e ) =>
1544+ {
1545+ App . CopyText ( Native . OS . GetAbsPath ( _repo . FullPath , selectedSingleFolder ) ) ;
1546+ e . Handled = true ;
1547+ } ;
1548+
1549+ menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
1550+ menu . Items . Add ( copyPath ) ;
1551+ menu . Items . Add ( copyFullPath ) ;
1552+ }
14831553 }
14841554
14851555 return menu ;
0 commit comments