I want to check the file status, then disable some menu or enable some menu.
how to do?
just like “show unsaved change”.
when no change, the menu item is disabled
I want to check the file status, then disable some menu or enable some menu.
how to do?
just like “show unsaved change”.
when no change, the menu item is disabled
You can disable the menu item pragmatically in your WindowCommand sublcass like this:
class MyMenuCommand(sublime_plugin.WindowCommand):
def is_enabled(self):
return False # or True