@@ -2248,9 +2248,8 @@ proc do_git_gui {} {
2248
2248
}
2249
2249
}
2250
2250
2251
- proc do_explore {} {
2252
- global _gitworktree
2253
- set explorer {}
2251
+ # Get the system-specific explorer app/command.
2252
+ proc get_explorer {} {
2254
2253
if {[ is_Cygwin] || [ is_Windows] } {
2255
2254
set explorer " explorer.exe"
2256
2255
} elseif {[ is_MacOSX] } {
@@ -2259,9 +2258,23 @@ proc do_explore {} {
2259
2258
# freedesktop.org-conforming system is our best shot
2260
2259
set explorer " xdg-open"
2261
2260
}
2261
+ return $explorer
2262
+ }
2263
+
2264
+ proc do_explore {} {
2265
+ global _gitworktree
2266
+ set explorer [ get_explorer]
2262
2267
eval exec $explorer [ list [file nativename $_gitworktree ] ] &
2263
2268
}
2264
2269
2270
+ # Open file relative to the working tree by the default associated app.
2271
+ proc do_file_open {file} {
2272
+ global _gitworktree
2273
+ set explorer [ get_explorer]
2274
+ set full_file_path [ file join $_gitworktree $file ]
2275
+ exec $explorer [ file nativename $full_file_path ] &
2276
+ }
2277
+
2265
2278
set is_quitting 0
2266
2279
set ret_code 1
2267
2280
@@ -3513,9 +3526,11 @@ tlabel .vpane.lower.diff.header.file \
3513
3526
-justify left
3514
3527
tlabel .vpane.lower.diff.header.path \
3515
3528
-background gold \
3516
- -foreground black \
3529
+ -foreground blue \
3517
3530
-anchor w \
3518
- -justify left
3531
+ -justify left \
3532
+ -font [ eval font create [font configure font_ui] -underline 1] \
3533
+ -cursor hand2
3519
3534
pack .vpane.lower.diff.header.status -side left
3520
3535
pack .vpane.lower.diff.header.file -side left
3521
3536
pack .vpane.lower.diff.header.path -fill x
@@ -3530,8 +3545,12 @@ $ctxm add command \
3530
3545
-type STRING \
3531
3546
-- $current_diff_path
3532
3547
}
3548
+ $ctxm add command \
3549
+ -label [ mc Open] \
3550
+ -command {do_file_open $current_diff_path }
3533
3551
lappend diff_actions [ list $ctxm entryconf [$ctxm index last] -state]
3534
3552
bind_button3 .vpane.lower.diff.header.path " tk_popup $ctxm %X %Y"
3553
+ bind .vpane.lower.diff.header.path <Button-1> {do_file_open $current_diff_path }
3535
3554
3536
3555
# -- Diff Body
3537
3556
#
0 commit comments