Mercurial bundle fix
Mercurial bundle was failing for me for some time and I finaly decided to fix it.
Below is the patch fixing the error. Apparently the com.macromates.textmate.plist file doesn't
always have the 'OakTextViewNormalFontName' property. I checked standard bundles and found
in the TextMate.bundle almost same code but with defaults for font name and size.
Corresponding change for Mercurial is in the below patch.
------ cut ------
* Fix bundle error when missing font prefs
diff -r 98bb64167077 Pristine Copy/Bundles/Mercurial.tmbundle/Support/getfontpref.rb
--- a/Pristine Copy/Bundles/Mercurial.tmbundle/Support/getfontpref.rb Thu Aug 02 12:07:30 2007 +0300
+++ b/Pristine Copy/Bundles/Mercurial.tmbundle/Support/getfontpref.rb Thu Aug 02 12:46:36 2007 +0300
@@ -6,12 +6,12 @@ textmate_pref_file = '~/Library/Preferen
$prefs = OSX::PropertyList.load(File.open(File.expand_path(textmate_pref_file)))
def getfontname
- font_name = $prefs['OakTextViewNormalFontName']
+ font_name = $prefs['OakTextViewNormalFontName'] || 'Monaco'
font_name = '"' + font_name + '"' if font_name.include?(' ') && !font_name.include?('"')
return font_name
end
def getfontsize
- font_size = ($prefs['OakTextViewNormalFontSize']).to_s
+ font_size = ($prefs['OakTextViewNormalFontSize'] || 11).to_s
font_size.sub!(/\.\d+$/, '')
end
\ No newline at end of file