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

Folds don't work with non-indented content #15690

Closed
Tracked by #40488
Zylann opened this issue Jan 14, 2018 · 7 comments
Closed
Tracked by #40488

Folds don't work with non-indented content #15690

Zylann opened this issue Jan 14, 2018 · 7 comments

Comments

@Zylann
Copy link
Contributor

Zylann commented Jan 14, 2018

Godot 3.0 master 6a4521d

In the following code, the array cannot be folded, which is unexpected.
The multiline string inside, however, ends up having folds, which is unexpected.

func _ready():
	var z = [
"""
Hello World!
	Yadayadayada
		yaaaaaaaaaa
"""
	]

image

At this point I would suggest code folding to become a bit more code aware, since it would also help with other languages that are not indentation-based (shaders, C#, JSON or whatever Godot can edit)

@vnen
Copy link
Member

vnen commented Jan 14, 2018

Yeah, I think that the GDScript module should decide which blocks are foldable and just have an API in TextEdit to set those blocks. Other code editors could use different criteria for code folding.

@akien-mga akien-mga added this to the 3.1 milestone Jan 14, 2018
@reduz
Copy link
Member

reduz commented Sep 6, 2018

@Paulb23
though I think this wont get fixed anytime soon..

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Jan 19, 2019
@Skaruts
Copy link

Skaruts commented Jul 28, 2019

In my experience from using other text editors/IDEs, this is common behavior.

@Skaruts
Copy link

Skaruts commented Aug 12, 2019

One thing that could be improved that sometimes causes this problem is the way Godot comments out code

Actually I was wrong. Godot folds comments regardless. What happens is godot doesn't fold them if there's no more code after them. So this folds nicely:

func do_things():
	something.x = 10
	something.y = 100

	# this is a user comment. The comments below are made through hotkey
#	things.append(cake)
#	things.append(bbq_sauce)

	derp = 10    # only if you remove this line it doesn't.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 1, 2020

Still valid in 0b910cd

@MatteoPiovanelli-Laser
Copy link

6b0b1a4
I'm seeing a similar folding "issue".
image
If I fold the _ready() function there, the comments below are folded in as well:
image
In my experience with other IDEs (mostly VS) that's unexpected.

@DinDotDout
Copy link
Contributor

The first issue mentioned appears to be resolved by now. The issue metioned by @MatteoPiovanelli-Laser is the same as in #84820 and #85016 will potentially fix it.

@KoBeWi KoBeWi closed this as completed Apr 30, 2024
@akien-mga akien-mga modified the milestone: 4.3 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants