Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add the on_exit event #2950

@evandrocoan

Description

@evandrocoan

Currently you can catch the Sublime Text exit by listening for the exit command as done by the MaxPane package:

class MaxPaneEvents(sublime_plugin.EventListener):
    def on_window_command(self, window, command_name, args):
        if command_name == "exit":
            # Un maximize all windows before exiting
            windows = sublime.windows()
            for w in windows:
                w.run_command("unmaximize_pane")

However this only works when the user exit the application with the exit command by going on the menu File -> Exit.

Related threads

  1. Allow event hooks to prevent the event from being further propagated #821 Allow event hooks to prevent the event from being further propagated
  2. Cloned views share the same settings object until ST is restarted #731 _ Cloned views share the same settings object until ST is restarted
  3. Event handlers for cloned views get called with the wrong view object #1253 _ Event handlers for cloned views get called with the wrong view object
  4. on event 'on_clone/on_new' view.window() does not exists.  #8 _ on event 'on_clone/on_new' view.window() does not exists.
  5. on_load is not dispatched when opening a window or maybe plugin_loaded miss some listener at startup #5 on_load is not dispatched when opening a window or maybe plugin_loaded miss some listener at startup

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions