czukowski opened a new issue, #8042: URL: https://github.com/apache/netbeans/issues/8042
### Apache NetBeans version Apache NetBeans 23 ### What happened Whenever code complete suggestions show up while multicaret is used, the edited code is broken, see examples below. This issue was originally reported in Jira and, I guess, overlooked during the migration to Github Issues: https://issues.apache.org/jira/browse/NETBEANS-5317 ### Language / Project Type / NetBeans Component Editor ### How to reproduce Example 1: ``` <?php class Test { FOO = 1 BAR = 2 BAZ = 3 // 🡤 place caret to each of the 3 lines directly above here. The intention here is to add 'const' keywords. } ``` Type 'c', wait for the suggestions and then type 'o'. The result will be: ``` cBAZo = 1 coBAZ = 2 coBAZ = 3 ``` Undo, then type 'c', and then accept the 'const' suggestion: ``` const BAZ = 1 const BAZ = 2 const BAZ = 3 ``` Undo again and attempt to avoid the issue by avoiding the invocation of code completion: type space, then move cursor one character to the left and then type 'const'. If instead of entering 'const', a suggestion is accepted, the code gets some extra spaces, although the names remain intact: ``` const FOO = 1 const BAR = 2 const BAZ = 3 ``` Example 2 (provided by @junichi11): In a java file, code is broken: ``` public final class Example { // ^ is caret ^test1; ^test2; ^test3; } ``` 1. type `p` 2. run code completion ([Ctrl] + [Space]) 3. select `private` 4. the result is following ``` public final class Example { // ^ is caret private test3^; private test3^; private ^test3; } ``` It seems that this occurs when code completion is run. ### Did this work correctly in an earlier version? No / Don't know ### Operating System Windows 11 ### JDK OpenJDK 64-Bit Server VM 22+36-2370 ### Apache NetBeans packaging Apache NetBeans provided installer ### Anything else There are many ways to reproduce the issue, including code completion for class properties, etc. ### Are you willing to submit a pull request? No -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
