-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fold decorators in with the code they affect #86
Comments
It's possible with backtracking, but it would break docstrings as currently implemented. I don't see why you'd want to as it greatly decreases readability and predictability of folds. I vote against including this functionality, even as an option. |
I don't see how it would affect readability. Maybe in a class it would make it harder to distinguish properties/getters/setters but in things like Django where you use decorators to check permissions, control caching, CSRF, transactions, etc I'm sometimes seeing almost as much code left outside of folds as inside. |
Personally, I can see the usefulness of this, but it would require major changes to the code to support it without introducing bugs. For now, it's probably not worth it for the relatively minor improvement. |
I realize this issue is a little dated but I would like to log my support for implementing it. Something like this could be really useful for projects that use flask, click, or a similar API. Once thing to keep in mind is that decorators can be multiple lines. I would offer my support but I don't know anything about vimscript. I can offer some example code to be folded, if that would be helpful. |
+1 for decorator folding
Don't really know how feasible that is though. |
I'd like to register another vote for including decorators in folds. I like the idea of including the |
I found SimpylFold while looking for a fold plugin that folds decorators, so am disappointed it doesn't. I like the idea of To add my 2c, I'd like to see built-in decorators
This would not be dissimilar to how Sphinx renders these (example). Of course it's not possible to know whether the decorator is genuinely the known one or a different decorator of the same name, but practically I would think matching by name is reliable enough. Some well-known decorators in the standard library would also be useful - specifically those that change the type of a function rather than just enhancing its behaviour
For example
could fold as
|
I would also like to seethe decorator folding feature implemented. |
With the following block:
This plugin folds it like:
But python-mode folds it like:
Would it be possible to fold in the decorators like python-mode?
The text was updated successfully, but these errors were encountered: