Home Download Buy Blog Forum Support

Can't reset zoom level

Can't reset zoom level

Postby Les on Fri Feb 22, 2013 12:00 pm

I'd like to point out na inconsistency between text zooming in a browser (Chrome or Firefox) vs Sublime Text.

In a browser you can use these shortcuts:

Cmd + zoom in
Cmd - zoom out
Cmd 0 - reset zoom level

Sublime supports zooming (in and out), but you can't reset zoom level. Is this a defect?
Les
 
Posts: 23
Joined: Tue Oct 11, 2011 4:12 pm

Re: Can't reset zoom level

Postby vitaLee on Fri Feb 22, 2013 12:57 pm

https://gist.github.com/vitaLee/5013169

add this to your keybindings
Code: Select all
{ "keys": ["super+0"], "command": "reset_font_size_to_user_defaults" }


this to your settings
Code: Select all
"default_font_size": 10


and create new command in file reset_font_size_commad.py under your user folder
Code: Select all
import sublime
import sublime_plugin


class ResetFontSizeToUserDefaultsCommand(sublime_plugin.ApplicationCommand):
    def run(self):
        s = sublime.load_settings("Preferences.sublime-settings")

        if s.has('default_font_size'):
            s.set('font_size', s.get('default_font_size'))
            sublime.save_settings("Preferences.sublime-settings")


that's it :)
Last edited by vitaLee on Fri Feb 22, 2013 1:03 pm, edited 1 time in total.
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: Can't reset zoom level

Postby weslly on Fri Feb 22, 2013 1:06 pm

Add this to your key bindings:

Code: Select all
{ "keys": ["super+0"], "command": "reset_font_size" }
weslly
 
Posts: 203
Joined: Sun Aug 28, 2011 3:57 am
Location: Brazil

Re: Can't reset zoom level

Postby Les on Fri Feb 22, 2013 2:09 pm

It would be easier if I didn't have to do this :idea:
Les
 
Posts: 23
Joined: Tue Oct 11, 2011 4:12 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 27 guests