Sublime Forum

EventListener broken on Sublime 4

#1

I’m a plugin developer. My plugin doesn’t work on Sublime 4. After doing some tests, I found the EventListener can’t be triggered. The following snippet is a simple plugin. It won’t print anything when I modify the view context. I can’t figure out what happened. Could someone help me out? Thanks!

import sublime
import sublime_plugin

class SimpleTest(sublime_plugin.EventListener):
    def on_modified(self, view):
        print("modified")
0 Likes

#2

Works fine for me.

0 Likes

#3

Do you use a localization plugin? If yes, try after re-install the localization plugin.

0 Likes

#4

Note that a plugin must be located in root path of a package. If your plugin code is organized in sub directories, you need a “main” plugin in root, which imports all API classes (commands, eventlisteners) to publish them to ST.

0 Likes

#5

Thanks for everyone’s reply. I finally find the problem is caused by override installation. My Sublime is a portable version so I decompress the latest package directly onto Sublime 3. This approach is totally wrong. Tons of functionalities are broken in this way.

0 Likes