Sublime Forum

Window open/close events?

#1

Hi

I want to start action every time user opens/closes new project. EventListener exposes only new “buffer” or new “file” is loaded, this adds a lot of overhead.

Is there a simpler solution than checking every file window object project ?

0 Likes

#2

How do you know when the user opened a new project by checking each buffer?

Currently I am only able to detect it when listening the command open_recent_project_or_workspace:

class SampleListener( sublime_plugin.EventListener ):

    def on_window_command( self, window, command, args ):

        # print( "About to execute " + command )

        if command == "open_recent_project_or_workspace":

            # print( "On " + command )

0 Likes