diff --git a/git-gui.sh b/git-gui.sh
index e495046c3b9a99106e8fa3506aad45bd911dd5c8..62e165227633338cdc8deaede8cfd07ea6ddd804 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
exit 1
}
exit 1
}
+catch {rename send {}} ; # What an evil concept...
+
######################################################################
##
## enable verbose loading?
######################################################################
##
## enable verbose loading?
}
}
}
}
+######################################################################
+##
+## Fake internationalization to ease backporting of changes.
+
+proc mc {fmt args} {
+ set cmk [string first @@ $fmt]
+ if {$cmk > 0} {
+ set fmt [string range $fmt 0 [expr {$cmk - 1}]]
+ }
+ return [eval [list format $fmt] $args]
+}
+
######################################################################
##
## read only globals
######################################################################
##
## read only globals
global env _search_exe _search_path
if {$_search_path eq {}} {
global env _search_exe _search_path
if {$_search_path eq {}} {
- if {[is_Cygwin]} {
+ if {[is_Cygwin] && [regexp {^(/|\.:)} $env(PATH)]} {
set _search_path [split [exec cygpath \
--windows \
--path \
set _search_path [split [exec cygpath \
--windows \
--path \
return $m
}
return $m
}
+proc rmsel_tag {text} {
+ $text tag conf sel \
+ -background [$text cget -background] \
+ -foreground [$text cget -foreground] \
+ -borderwidth 0
+ $text tag conf in_sel -background lightgray
+ bind $text <Motion> break
+ return $text
+}
+
######################################################################
##
## find git
######################################################################
##
## find git
set _git [_which git]
if {$_git eq {}} {
catch {wm withdraw .}
set _git [_which git]
if {$_git eq {}} {
catch {wm withdraw .}
- error_popup "Cannot find git in PATH."
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [mc "git-gui: fatal error"] \
+ -message [mc "Cannot find git in PATH."]
exit 1
}
exit 1
}
set pck [split $buf_rlo "\0"]
set buf_rlo [lindex $pck end]
foreach p [lrange $pck 0 end-1] {
set pck [split $buf_rlo "\0"]
set buf_rlo [lindex $pck end]
foreach p [lrange $pck 0 end-1] {
- merge_state [encoding convertfrom $p] ?O
+ set p [encoding convertfrom $p]
+ if {[string index $p end] eq {/}} {
+ set p [string range $p 0 end-1]
+ }
+ merge_state $p ?O
}
rescan_done $fd buf_rlo $after
}
}
rescan_done $fd buf_rlo $after
}
set font [lindex $option 1]
if {[catch {
foreach {cn cv} $repo_config(gui.$name) {
set font [lindex $option 1]
if {[catch {
foreach {cn cv} $repo_config(gui.$name) {
- font configure $font $cn $cv
+ font configure $font $cn $cv -weight normal
}
} err]} {
error_popup "Invalid font specified in gui.$name:\n\n$err"
}
} err]} {
error_popup "Invalid font specified in gui.$name:\n\n$err"
.vpane.files add .vpane.files.workdir -sticky nsew
foreach i [list $ui_index $ui_workdir] {
.vpane.files add .vpane.files.workdir -sticky nsew
foreach i [list $ui_index $ui_workdir] {
- $i tag conf in_diff -background lightgray
- $i tag conf in_sel -background lightgray
+ rmsel_tag $i
+ $i tag conf in_diff -background [$i tag cget in_sel -background]
}
unset i
}
unset i
set ::cursorX $x
set ::cursorY $y
if {$::ui_index eq $::current_diff_side} {
set ::cursorX $x
set ::cursorY $y
if {$::ui_index eq $::current_diff_side} {
- set s normal
set l "Unstage Hunk From Commit"
} else {
set l "Unstage Hunk From Commit"
} else {
- if {$current_diff_path eq {}
- || ![info exists file_states($current_diff_path)]
- || {_O} eq [lindex $file_states($current_diff_path) 0]} {
- set s disabled
- } else {
- set s normal
- }
set l "Stage Hunk For Commit"
}
set l "Stage Hunk For Commit"
}
- if {$::is_3way_diff} {
+ if {$::is_3way_diff
+ || $current_diff_path eq {}
+ || ![info exists file_states($current_diff_path)]
+ || {_O} eq [lindex $file_states($current_diff_path) 0]} {
set s disabled
set s disabled
+ } else {
+ set s normal
}
$ctxm entryconf $::ui_diff_applyhunk -state $s -label $l
tk_popup $ctxm $X $Y
}
$ctxm entryconf $::ui_diff_applyhunk -state $s -label $l
tk_popup $ctxm $X $Y