-
Notifications
You must be signed in to change notification settings - Fork 82
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
Closes issue #71 #80
base: master
Are you sure you want to change the base?
Closes issue #71 #80
Conversation
- Adds AutoSwitchPane EventListener to auto-group files by syntax
I would suggest using scope selectors instead of the path to the syntax file, but that's a preference thing I guess. I just find it easier to work with scopes compared to the long file paths. |
That's a good point - let me take a look at that. I saw a good example in SublimeCodeIntel - LN 411 that I may take a look at. I'll update the PR and submit for code review. Thanks! |
FYI, there is a |
- Update get_syntax_name to use scope if available
Sorry, I didn't get an e-mail that you'd pushed another commit! Let me take a look. |
@FichteFoll: Will there be any concerns about nested scopes? Or are those avoided by checking at the last position of the file? I haven't worked with scopes or grammars a lot. |
@23maverick23: This looks good! I know I made a lot of comments but I hope you know I appreciate your pull request 🍰 |
@adzenith Holy pull request comments! 😜 I love it!
Let me know if you have any other concerns. In the meantime, I'll get working on some updates! |
@adzenith, I do it by getting the scope name at point 0 in the view, splitting the string (by spaces), extracting the firsts token and then running sublime.match_selector on it. I should have a code example for this in one of my repos but I'm on mobile right now. |
I'm not sure if this is 100% what @fbm-static was looking for, but this seemed like a more practical approach to the underlying issue. When enabled, Origami will attempt to move loaded files of the same syntax into the same group (if available). You can also selectively enable this feature for specific syntax types in your User or Project settings files as well (in case that ever needs to happen). This feature is opt-in (e.g. disabled by default).
Let me know your thoughts. It should work in ST2 & ST3, although admittedly I was having some issues/inconsistencies with how ST2 wanted to deal with groups.