-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add missing punctuation to the default TextEdit word separators #93656
Conversation
scene/gui/text_edit.cpp
Outdated
@@ -472,7 +472,7 @@ String TextEdit::Text::get_custom_word_separators() const { | |||
} | |||
|
|||
String TextEdit::Text::get_default_word_separators() const { | |||
String concat_separators = "´`~$^=+|<>"; | |||
String concat_separators = "`~!@#$%^&*()-=+[{]}|;:'\",.<>/?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe those can be excluded with sub-ranges of the ASCII table?
BTW looking at the list, aren't we missing \
(which would need to be escaped as \\
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe those can be excluded with sub-ranges of the ASCII table?
Do you mean iterating through char-codes instead of hardcoding them?
BTW looking at the list, aren't we missing \ (which would need to be escaped as \)?
Yes! You are right. Will be added as well. Iterating would have prevented that, probably :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe those can be excluded with sub-ranges of the ASCII table?
Do you mean iterating through char-codes instead of hardcoding them?
Yes, though looking at the table it's not a single block so it might not be worth it.
Maybe we can at least list them in the same order as in the ASCII table so that it's easy to spot which ones are included or left out (in particular _
which from a quick look is the only punctuation from the table that we're not including, as we want to support snake_case
identifiers I suppose).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in particular _ which from a quick look is the only punctuation from the table that we're not including, as we want to support snake_case identifiers I suppose
_
is intentionally left out, because some may prefer selecting the whole word if they prefer this naming convention. If _
needs to be treated as seperator, one should add it into custom_word_separators
field in the settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the doc formatting fix, this looks good to me.
Thanks! Would it be also possible to check whether the regression is gone? I cannot reproduce the bug; hopefully fixed it. |
It seems like this change breaks a unit test for TextEdit:
You can test locally by building with |
Thanks. Forgot to disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, I confirm this fixes the linked issue and seems to reintroduce the same expected behavior as in 4.2.2-stable.
Thanks! |
Fixes #93618, regression after #92514
Adds to the default separators the following list:
~!@#$%^&*()-=+[{]}|;:'\",.<>;/?