Mercurial bundle fix

View: New views
2 Messages — Rating Filter:   Alert me  

Mercurial bundle fix

by Vitaly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: Mercurial bundle fix

by Fred B-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 8/2/07, Vitaly <vitaly@...> wrote:

>
> 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.

Thanks for the patch, I'll commit it ASAP.

BTW, I've worked on the Mercurial bundle and it will be updated soon.

NB: You used the wrong list, this list if for plugins, not bundles and
it's better to use the standard list anyway ;).

--
FredB
_______________________________________________
textmate-plugins mailing list
textmate-plugins@...
http://lists.macromates.com/mailman/listinfo/textmate-plugins