@@ -594,15 +594,19 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
594
594
if ( _selectedUnstaged . Count == 1 )
595
595
{
596
596
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 ) ;
598
598
599
599
var explore = new MenuItem ( ) ;
600
600
explore . Header = App . Text ( "RevealFile" ) ;
601
601
explore . Icon = App . CreateMenuIcon ( "Icons.Explore" ) ;
602
602
explore . IsEnabled = File . Exists ( path ) || Directory . Exists ( path ) ;
603
603
explore . Click += ( _ , e ) =>
604
604
{
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
+
606
610
e . Handled = true ;
607
611
} ;
608
612
menu . Items . Add ( explore ) ;
@@ -982,7 +986,11 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
982
986
copy . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
983
987
copy . Click += ( _ , e ) =>
984
988
{
985
- App . CopyText ( change . Path ) ;
989
+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
990
+ App . CopyText ( change . Path ) ;
991
+ else
992
+ App . CopyText ( selectedSingleFolder ) ;
993
+
986
994
e . Handled = true ;
987
995
} ;
988
996
menu . Items . Add ( copy ) ;
@@ -992,7 +1000,11 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
992
1000
copyFullPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
993
1001
copyFullPath . Click += ( _ , e ) =>
994
1002
{
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
+
996
1008
e . Handled = true ;
997
1009
} ;
998
1010
menu . Items . Add ( copyFullPath ) ;
@@ -1154,6 +1166,27 @@ public ContextMenu CreateContextMenuForUnstagedChanges(string selectedSingleFold
1154
1166
1155
1167
menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
1156
1168
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 ) ;
1157
1190
}
1158
1191
}
1159
1192
@@ -1205,15 +1238,19 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
1205
1238
if ( _selectedStaged . Count == 1 )
1206
1239
{
1207
1240
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 ) ;
1209
1242
1210
1243
var explore = new MenuItem ( ) ;
1211
1244
explore . IsEnabled = File . Exists ( path ) || Directory . Exists ( path ) ;
1212
1245
explore . Header = App . Text ( "RevealFile" ) ;
1213
1246
explore . Icon = App . CreateMenuIcon ( "Icons.Explore" ) ;
1214
1247
explore . Click += ( _ , e ) =>
1215
1248
{
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
+
1217
1254
e . Handled = true ;
1218
1255
} ;
1219
1256
@@ -1391,7 +1428,11 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
1391
1428
copyPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
1392
1429
copyPath . Click += ( _ , e ) =>
1393
1430
{
1394
- App . CopyText ( change . Path ) ;
1431
+ if ( string . IsNullOrEmpty ( selectedSingleFolder ) )
1432
+ App . CopyText ( change . Path ) ;
1433
+ else
1434
+ App . CopyText ( selectedSingleFolder ) ;
1435
+
1395
1436
e . Handled = true ;
1396
1437
} ;
1397
1438
@@ -1400,7 +1441,11 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
1400
1441
copyFullPath . Icon = App . CreateMenuIcon ( "Icons.Copy" ) ;
1401
1442
copyFullPath . Click += ( _ , e ) =>
1402
1443
{
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
+
1404
1449
e . Handled = true ;
1405
1450
} ;
1406
1451
@@ -1480,6 +1525,31 @@ public ContextMenu CreateContextMenuForStagedChanges(string selectedSingleFolder
1480
1525
menu . Items . Add ( new MenuItem ( ) { Header = "-" } ) ;
1481
1526
menu . Items . Add ( ai ) ;
1482
1527
}
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
+ }
1483
1553
}
1484
1554
1485
1555
return menu ;
0 commit comments