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

Explain the difference between is_visible and is_enabled when implementing a {Application,Window,Text}Command #23

Open
rwols opened this issue Jul 19, 2020 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@rwols
Copy link

rwols commented Jul 19, 2020

I keep forgetting what the differences are. And what the exact effects are. The ST3 docs are pretty much useless in this regard.

@Ultra-Instinct-05
Copy link
Contributor

Ultra-Instinct-05 commented Jul 20, 2020

I believe it is kinda dependent. In case if the command is registered in the command palette, then both of them have the same behavior i.e. the command doesn't show up if you search for it via the caption. (if you return False that is)

If it's a menu entry, then is_enabled returning False will gray out & disable the menu entry. is_visible returning False will not make it appear in the menu at all.

If it is a key binding, then is_visible has no effect. is_enabled returning False on the other hand will not make the command execute via the binding.

In case of mousemap files also, is_visible has no effect. is_enabled returning False will disable that button from executing the command or press_command (provided the said command/press_command has is_enabled returning False)

@rwols
Copy link
Author

rwols commented Jul 20, 2020

Sounds like a pull-request ;)

@FichteFoll FichteFoll added the documentation Improvements or additions to documentation label Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants