-
Notifications
You must be signed in to change notification settings - Fork 855
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
javascript select Identifier id tag html # #7961
Comments
Do you mean, that you double clicked on the identifier and the automatic selection was different? Because manually selecting the right range will obviously work. |
In js files it is not working double clicking on "#identifier" is always selecting the text and the # plus if it is ". identifier" only selects the text for other special characters netbens in js files only selects the text plus if it is the # select the text and #. |
I guess the thing here it is an intended feature. It sounds weird but it make totally sense and yes it should be consistent. When you have a string like "ed-sheeran" and you set the cursor at the end of sheeran and hit ctrl + left_arrow (Windows) you navigate to the beginning of sheeran, becuase a dash is a delimiter like a space and you can navigate to it. Unfortunately a hastag is not supported in JS, also not an underscore. So when you have #sheeran and you hit ctrl + left_arrow you move the cursor to sheeran, not in front of the hashtag. This is not a bug, but this is an inconsistency behaviour of different editor supports in NetBeans. Maybe this needs an option for this. |
Yes, it's not an error, but I think it's an inconsistency or failure. Because from version 20 below in js files, if you double click on a text with # it will only select the text. From version 21 to 23 I stop doing this. And as incredible as it may seem, I always prefer to work on version 20... |
This is most probably a result of #6741. That PR adds '#' to the valid characters in identifiers in JS to support private properties |
The problem is indeed, that the primary language is used for determining which "rules" to use for finding word boundaries. It is possible to fix this, but my gut feeling is, that it will be hard to find the right location and ensure, there are no bad side effects. Start point for the search is |
Apache NetBeans version
Apache NetBeans 23
What happened
Hello, there is a flaw from version 21 to 23 that in version 20, when selecting an identifier id # in the javascript file, it selects all text (name and #)
But if it is javascript in a php file, it only selects the text, not the #.
How can I fix
Language / Project Type / NetBeans Component
No response
How to reproduce
Hello, there is a flaw from version 21 to 23 that in version 20, when selecting an identifier id # in the javascript file, it selects all text (name and #)
But if it is javascript in a php file, it only selects the text, not the #.
How can I fix
Did this work correctly in an earlier version?
No / Don't know
Operating System
windows
JDK
jdk-22
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
Yes
The text was updated successfully, but these errors were encountered: