You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot 4.3 dev 4 (probably previous versions as well)
System information
Manjaro Linux (DE: Cinnamon v6.0.4) 64 bits (but probably all systems)
Issue description
When using the comment regions in a script, if a string inside a region contains "#endregion" alone on a single line, it triggers the region's end prematurely and then messes the region feature.
Steps to reproduce
Copy the following code inside a script and try to fold the region TEST (comments are only there to explain the behavior):
#region TEST
# This region should be folded up to the EOF comment
func test() -> void:
# Dummy content
var testing : String = ""
# To trigger the region's end, the string must be the first thing on the line, with or without tabs in front
# Single quoted or literal strings does the same effect
testing += """
#endregion
"""
# Some more content which will not be folded with the region!
var new_var : int = 3
# The real end of the region, when folding TEST we should not see any of the test() method content
#endregion
# EOF comment
The result is a partially folded region (see screenshots below).
Unfolded region:
Actual folded region:
Expected result:
Minimal reproduction project (MRP)
Not necessary.
The text was updated successfully, but these errors were encountered:
I tested more in depth and if the string is for example "#region REGION_NAME", the corresponding region is created as well.
In short: if the string contains "#region" or "#endregion" it is interpreted as a real region keyword, where it should not be treated at all. Hope this helps.
@RafaelRain18 Feel free to start working on it. We usually prefer not to assign issues. Your comment is enough to inform other contributors of your intention. If you need help, you can ask in the Godot Contributors Chat. Thanks!
Tested versions
Godot 4.3 dev 4 (probably previous versions as well)
System information
Manjaro Linux (DE: Cinnamon v6.0.4) 64 bits (but probably all systems)
Issue description
When using the comment regions in a script, if a string inside a region contains "#endregion" alone on a single line, it triggers the region's end prematurely and then messes the region feature.
Steps to reproduce
Copy the following code inside a script and try to fold the region TEST (comments are only there to explain the behavior):
The result is a partially folded region (see screenshots below).
Unfolded region:
Actual folded region:
Expected result:
Minimal reproduction project (MRP)
Not necessary.
The text was updated successfully, but these errors were encountered: