-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Commenting code with Ctrl+K
now inserts the #
in front of the first keyword rather than at the start of the line
#83571
Comments
#
in front of the first keyword rather than at the start of the line#
in front of the first keyword rather than at the start of the line
#
in front of the first keyword rather than at the start of the lineCtrl+K
now inserts the #
in front of the first keyword rather than at the start of the line
Yeah, this is intentional and is even listed as an improvement. If you think this is undesirable, you may propose to restore the old behavior as an option. |
I disagree. I like the change and consider it an improvement. It's easy to see what was mass-commented by the fact that there's a mass of text that is all commented. The old way of adding And also it fixes this problem: Which has been a real pain point for me the whole time I've been using Godot.
I agree that this is undesirable. But I don't really see how to fix this. The naïve approach is just to check if a line is already commented, and if so, don't add another So IMO while turning a comment ( |
I agree with @mieldepoche, it's really hard to detect what was mass-commented. The old behavior wasn't perfect, but it was certainly better than this new one in my opinion. I hope that an option to use the old behavior will be added in the future |
I like the new way - it doesn't interfere with indenting/dedenting blocks of code. If a lot of people prefer the old way, please add an option so I can have it the new way! lol |
Proposal: godotengine/godot-proposals#8211 |
On the contrary. As shown above, the old way was functionally broken when you had indented lines of code commented out and couldn't uncomment them with the hotkey. The new way finally works properly but can result in undesired visual/stylistic side effects which have minimal to no effect on the actual functionality of the code. Personally, I don't think it makes sense to include and maintain an option that reverts to behavior that is literally broken. But I'm not against people having the option, as long as the working behavior is the default. |
For me personally it was a feature, not a bug: commented-out code was commented out with a hashtag at the beginning of the line, while actual comments (hints, reminders, todos, etc) were commented at the beginning of the comment. When commenting out a big chunk of code, there was a clear separation, and if an actual comment got caught in the selection, it was still easy to distinguish the comment from the commented-out code. I havent moved to 4.2 yet and I dont know what the interaction is when ctrl+K finds an already commented out line in the selection, but I can already see it being harder to spot the actual comment inside a mass-commented code. Does anyone use ctrl+k to write actual comments, rather than comment/uncomment chunks of code? |
I personally have it bound closer to my left hand as I toggle code fairly frequently. I do prefer the new behavior as it matches a general convention: A space after "#" for explanations, no space for commented out code. |
Godot version
v4.2.beta.custom_build [7f884b4]
System information
linux
Issue description
Commenting a line using Ctrl+K inserts a
#
in front of the first keyword.This:
##
) which are coloured differently.simplescreenrecorder-2023-10-18_19.20.21.mp4
Steps to reproduce
Minimal reproduction project
any script
The text was updated successfully, but these errors were encountered: