diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2006-11-12 15:45:35 -0500 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2006-11-13 00:10:37 -0500 |
commit | 7b64d0b7d62ec0eb6e8b37f0be2e62f2a719de16 (patch) | |
tree | a0eaf9035e4b4e52b57323dd3358a575517777d0 /git-gui | |
parent | 4af2c384eaae62300765e205c705c7741dd7dd31 (diff) | |
download | git-7b64d0b7d62ec0eb6e8b37f0be2e62f2a719de16.tar.gz git-7b64d0b7d62ec0eb6e8b37f0be2e62f2a719de16.tar.xz |
git-gui: Correct bugs in font config handling.
Apparently Tcl is being helpful on Windows during exec and is throwing a
\ in front of every { it finds in the string. I'm guessing they think
the value might be read by another Tcl program? Anyway, Git faithfully
stores the \{ sequence and sends it back that way to Tcl, at which point
Tcl parses the list wrong and starts to break it in the middle of any
element which contains spaces. Therefore a list such as:
-family {Times New Roman}
gets broken up into the pairs:
{-family \{Times}
{New Roman}
which is very incorrect. So now we replace all { and } with "", at which
point Tcl doesn't throw \ in front of the " on the way out to Git yet it
reads it correctly as a list on the way back in.
I also found and fixed a bug in the way we restored the fonts when the
user presses Restore Defaults in the options dialog.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-x | git-gui | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -91,7 +91,8 @@ proc save_config {} { if {$value == $default_config($name)} { catch {exec git repo-config --global --unset $name} } else { - catch {exec git repo-config --global $name $value} + regsub -all "\[{}\]" $value {"} value + exec git repo-config --global $name $value } set global_config($name) $value if {$value == $repo_config($name)} { @@ -107,7 +108,8 @@ proc save_config {} { if {$value == $global_config($name)} { catch {exec git repo-config --unset $name} } else { - catch {exec git repo-config $name $value} + regsub -all "\[{}\]" $value {"} value + exec git repo-config $name $value } set repo_config($name) $value } @@ -1803,7 +1805,7 @@ proc do_options {} { } proc do_restore_defaults {} { - global font_descs default_config + global font_descs default_config repo_config global repo_config_new global_config_new foreach name [array names default_config] { @@ -1813,7 +1815,7 @@ proc do_restore_defaults {} { foreach option $font_descs { set name [lindex $option 0] - set repo_config($name) $default_config(gui.$name) + set repo_config(gui.$name) $default_config(gui.$name) } apply_config |