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

Ctrl-dragging file from FileSystem to code replaces starting digit with underscore #82773

Closed
miv391 opened this issue Oct 4, 2023 · 0 comments · Fixed by #82786
Closed

Ctrl-dragging file from FileSystem to code replaces starting digit with underscore #82773

miv391 opened this issue Oct 4, 2023 · 0 comments · Fixed by #82786
Milestone

Comments

@miv391
Copy link
Contributor

miv391 commented Oct 4, 2023

Godot version

v4.2.dev6.official [57a6813]

System information

Godot v4.2.dev6 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 31.0.15.3640) - Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 Threads)

Issue description

Ctrl-dragging file from FileSystem to code replaces first character with underscore when the file's first character is a digit.

kuva

It seems that all invalid characters are replaced with underscore. But when the file name starts with a digit (invalid character only at the beginning), that seems too harsh. I would suggest just adding extra underscrore to the beginning of the variable name. So in this example, I would expect variable name _123_ICON instead of _23_ICON.

Steps to reproduce

  1. Duplicate icon.svg and rename the duplicate as 123_icon.svg
  2. Ctrl-drag both icon.svg and 123_icon.svg to code
    ->
const _23_ICON = preload("res://123_icon.svg")
const ICON = preload("res://icon.svg")

Minimal reproduction project

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants