-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Make fold/unfold line shortcut work anywhere within a foldable section, not just on the line with the folding marker #5061
Comments
Hi, |
This is the code that is called when using the Fold Line shortcut: https://github.com/godotengine/godot/blob/26bed8aa85fc2f98e38552a82929e1deb5b29d8a/scene/gui/code_edit.cpp#L1637-L1644 You will need to modify it to allow folding from anywhere, then recompile the editor source code to test your changes. |
Hmmm just above the lines you mentioned, there is this function : fold_all_lines, maybe it is already implemented yet ? (Maybe it is what you suggested when you say "from anywhere"...) Also, line 2272 there is this : ClassDB::bind_method(D_METHOD("fold_all_lines"), &CodeEdit::fold_all_lines); |
This line binds the |
Hi everyone. |
I don't know since when it is available, but it is. |
This comment was marked as outdated.
This comment was marked as outdated.
Maybe @vivienprouvot is referring to their previous comment about the shortcut not working on Linux? |
Describe the project you are working on
2D-game - any will do
Describe the problem or limitation you are having in your project
Currently folding "Fold/Unfold Line" of a single function works via shortcut if the user is positioned at the head of the function only.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add support for folding if cursor is placed anywhere in function to omit that I've to scroll to the beginning of (long) functions first.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If "Fold Line" (Alt-F) is pressed inside a function body it folds the method like it does at the head of the function, too.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Existing editor feature.
Is there a reason why this should be core and not an add-on in the asset library?
Improving an existing script editor feature.
The text was updated successfully, but these errors were encountered: