Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_zoom_on_focus doesn't play nice with widget plugins #148

Open
dyereh opened this issue May 9, 2019 · 5 comments
Open

auto_zoom_on_focus doesn't play nice with widget plugins #148

dyereh opened this issue May 9, 2019 · 5 comments

Comments

@dyereh
Copy link

dyereh commented May 9, 2019

Hi - I really like the auto_zoom_on_focus feature but have found that it doesn't work with widget plugins such as terminus. I believe it is due to this bit of code:

if view.settings().get("is_widget"):
	return

Any way we this feature could be made to work in widgets such as terminus?

@adzenith
Copy link
Member

adzenith commented Jul 4, 2019

Just to clarify - you're saying that you want terminus to resize when it gets focus? I'm not sure if the API allows resizing widgets.

@dyereh
Copy link
Author

dyereh commented Aug 15, 2019

Yup that's it - will see if I can get it to work and let ya know

@dyereh
Copy link
Author

dyereh commented Aug 17, 2019

Yup just tested - by deleting those two lines terminus will also resize. I'm curious why these were there to begin with. Did you not want widgets resizing?

This is a fantastic feature particularly when I switch to a single monitor and don't have as much real-estate but don't wanna change my pane layout

@dyereh
Copy link
Author

dyereh commented Aug 19, 2019

I also found it useful to be able to toggle the auto_zoom_on_focus feature on and off from a keybinding. Not sure if this is a useful thing to include in the plugin. Right now I just have a little bit of code to wrap it

  { "keys": ["Z"], "command": "toggle_plugin_setting", "args": {"file": "Origami.sublime-settings", "key": "auto_zoom_on_focus", "toggleValue1": false, "toggleValue2":0.5 } },
import sublime, sublime_plugin

## Toggle a setting for any plugin
class TogglePluginSetting(sublime_plugin.ApplicationCommand):
    toggle = 0

    def run(self, file, key, toggleValue1, toggleValue2):
        print(self.toggle)
        settings = sublime.load_settings(file)

        if self.toggle == 0:
            value = toggleValue1
        else:
            value = toggleValue2

        settings.set(key, value)
        sublime.save_settings(file)

        self.toggle = (self.toggle + 1) % 2

I could work on this feature in at some point if you found it useful.. otherwise this plugin works just fine for my personal use

@juliangarnier
Copy link

+1, being able to resize the pane containing a terminus instance would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants