[TxMt Plugins] Mercurial bundle fix
Vitaly
vitaly at bitwine.com
Thu Aug 2 09:49:30 UTC 2007
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
--
View this message in context: http://www.nabble.com/Mercurial-bundle-fix-tf4205140.html#a11961456
Sent from the textmate-plugins mailing list archive at Nabble.com.
More information about the textmate-plugins
mailing list