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
Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.3699) - 12th Gen Intel(R) Core(TM) i7-12700F (20 Threads)
Issue description
Inserting a newline in the commented code and then uncomment all of them won't work, godot will think the new line (usually just a '\t' or '\n') is uncommented, so it assumes the whole code block is uncommented and will comment all the code again.
Comment will work when comment a empty line, by empty I mean the line only consist of '\t' '\n' and ' '
Steps to reproduce
For 1, write some code like this:
var a = 1
var b = 2
comment them by ctrl + k, and press enter after #var a = 1 to make a new line, it should look like this:
#var a = 1
#var b = 2
And uncomment all the three lines together, you will get this instead of uncommentting all the lines
##var a = 1
#
##var b = 2
For 2, it's trivial to reproduce.
Minimal reproduction project
Any project should work.
I has already fixed it in my local branch, but I think it need mroe disscussion about which behavior is intented and which is not.
I can understand the behaviour of point 2 to some extent but point 1 really brings inconvenience.
After the disscussion, I can update my fix and create a pr for it if necessary.
The text was updated successfully, but these errors were encountered:
I found an interesting case relating the detail of this code logic, in the code godot will first decide it is a comment behaviour or uncomment behaviour based on whether any line doesn't contain a '#'.
But when the code you want to operate only contains empty line, the origin logic will break if we just ignore empty lines, I added a special case in the code, take a look and your suggestions are welcomed.
AThousandShips
changed the title
Empty lines should be ignored when comment/uncommet code
Empty lines should be ignored when comment/uncomment code
Sep 9, 2023
Godot version
Godot v4.2.dev (fc99492)
System information
Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.3699) - 12th Gen Intel(R) Core(TM) i7-12700F (20 Threads)
Issue description
Steps to reproduce
For 1, write some code like this:
comment them by ctrl + k, and press enter after
#var a = 1
to make a new line, it should look like this:And uncomment all the three lines together, you will get this instead of uncommentting all the lines
For 2, it's trivial to reproduce.
Minimal reproduction project
Any project should work.
I has already fixed it in my local branch, but I think it need mroe disscussion about which behavior is intented and which is not.
I can understand the behaviour of point 2 to some extent but point 1 really brings inconvenience.
After the disscussion, I can update my fix and create a pr for it if necessary.
The text was updated successfully, but these errors were encountered: