Home Download Buy Blog Forum Support

sublime text resetting font size bug

sublime text resetting font size bug

Postby cricket9090 on Thu Oct 04, 2012 8:29 am

In my user config. file I have the following settings:

"font_face": "Inconsolata",
"font_size": 12,

If I increase the font using 'ctrl' + '+', and then go to preferences -> font -> reset. The font is not reset to "font_size", but to a much smaller size. and the setting '"font_size": 12' is removed from the user config. file (weird).

Does any body know of a custom keybinding/command, which I could use to reset the font size to "font_size"?

Note: I searched the forum and could not find this issue, apologies If it's already been reported.
cricket9090
 
Posts: 3
Joined: Mon Oct 01, 2012 8:51 am

Re: sublime text resetting font size bug

Postby bizoo on Thu Oct 04, 2012 9:50 am

If I remember well, reset font remove the font_size entry of your config file.
So it means that it's the default size that is used after, which is 10.

There's no command to set a specific font size, so you have to do yourself with something like:
Code: Select all
import sublime, sublime_plugin
class ResetFontSizeCustomCommand(sublime_plugin.ApplicationCommand):
    def run(self, size):
        settings = sublime.load_settings('Preferences.sublime-settings')
        settings.set('font_size', size)
        sublime.save_settings('Preferences.sublime-settings')

And call it with something like:
Code: Select all
run_command('reset_font_size_custom', {'size' : 12})

In addition, you can create you own settings ('custom_font_size') and use it instead of the parameter.
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: sublime text resetting font size bug

Postby cricket9090 on Thu Oct 04, 2012 9:16 pm

Thanks bizoo, really appreciate the help. I ended up using the custom command as you suggested and it works a treat! :D
cricket9090
 
Posts: 3
Joined: Mon Oct 01, 2012 8:51 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 21 guests