-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added two options: set 1 line above functions, ignore '/' symbols in $node references #3
base: master
Are you sure you want to change the base?
Conversation
Hello ! I didn't expect any issues or pull requests on this little project. Sorry for the late reply. I have a few comments before merging.
Also, could you squash your commits into one ? |
I made a few more tests with node names. Godot accepts any unicode characters, including for example emojis. The only forbidden characters are This example is the worst: the node name |
The Editor catches errors so you don't have to account for them in your aforementioned cases. E.g. In addition to $node names, there also the You can prevent the GDBeautify from running if there is a syntax error in the code. This function below called from func check_syntax() -> int:
var error = current_script.reload()
if error != OK:
# If it has errors, we printerr to Godot and end this function right here
printerr("GDBeautify: Syntax Error %s in Script. Cannot run. " % [error])
return error
# If there was no errors, we print a "succesful!" message or something like that
print("GDBeautify: Script loaded with no errors!")
return OK
## Beautifies the current script.
func _on_beautify_pressed():
if check_syntax():
return
###.....
###.... |
Thanks for looking at my changes :) |
@wyattbiker If you keep working on that feature, make sure to rebase to master. I have moved and renamed some files. |
I have added two options:
An option to add 1 empty line above functions instead of 2
This defaults to 2 lines, as in the original addon
An option to ignore '/' symbols in $node references when adding spaces around operators.
Note: I have added this option by treating $node references like text in quotes.
To delimit $node references I have assumed they start with $ and end with either either . = : tab space or EOL
As I am not sure if this is a complete list of delimiters, or if this option might somehow cause problems, I have labelled it as experimental, and turned it off by default.