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

Python context menu #684

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

evandrocoan
Copy link

@evandrocoan evandrocoan commented Aug 5, 2017

Issue:

  1. Hide Anaconda context menu entry on non-python projects #571 Hide Anaconda context menu entry on non-python projects

Copy link
Owner

@DamnWidget DamnWidget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @evandrocoan, just a couple of things.

First:
Why did you add the Context.sublime-menu to the .gitignore file? I don't really understand why the install_context is needed in first place, I guess is just a safety in case that ST3 is closed with the Context file being hidden and to guarantee a known state on initialization but I am not sure about the whole thing.

Second:
Do you think you could get this logic and create a new listener in the listeners sub package?

@evandrocoan
Copy link
Author

evandrocoan commented Aug 5, 2017

Hi,

  1. Because I we need to rename the file Context.sublime-menu to some else as Base Context.sublime-menu, then on plugin_loaded() we copy it or to Context.sublime-menu or Context.sublime-menu-hidden. So when upgrading the file Context.sublime-menu we only need to change the Base Context.sublime-menu. Also, would be a pain with git as both files Context.sublime-menu and Context.sublime-menu-hidden are constantly changing their names. We would be a lot of, a) the fine is missing now, b) the file is not missing now.
  2. I think I can, but a better solution would be writing a dedicated package to handle this for all other packages. For now I am short of time, so unless I am really required to write a package as for performance loss due too much threads being created. For example, the other related packages as https://github.com/DamnWidget/anaconda_rust/blob/master/Context.sublime-menu also has the menu entry, so if use them I would need to include this there too, which seems not nice to be doing around.

But perhaps we should just wait Sublime Text core implement this as a built-in feature:

  1. Allow hiding and disabling of menu items with submenus sublimehq/sublime_text#1859 Allow to hide .sublime-menu folders

@DamnWidget
Copy link
Owner

The thing is this will make ST3 to dynamically reload the Context file giving some kind of log behind in the console, I understand that this solution will work but I think is way too clever and a bit hacky. Maybe is worth just to wait till the right fix come from the ST3 development team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants